Atozed Forums
Problem to create a modal form - SOLVED - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: Problem to create a modal form - SOLVED (/thread-3358.html)

Pages: 1 2


RE: Problem to create a modal form - Alexandre Machado - 08-05-2023

That's weird that it didn't work for you. It should and I tested it with this workaround before implementing my fix and, as far as I could tell, it worked correctly.

Anyway, the new update will be available later today.

Cheers,


RE: Problem to create a modal form - StephB - 08-07-2023

Hi Alexandre,
New release downloaded and installed, but my modal still not working properly Cry

Here is a screencast of my problem, hope you can access it : https://www.screencast.com/t/DJg2IZJuCX
I just noticed that, after the first try, the URL is updated from localhost:8888 to http://localhost:8888/?IWEDITDATE_IWFRAMEMODAL_CARD2=2023-08-08&IWBUTTONVALIDATE_IWFRAMEMODAL_CARD2=Validate.
And, in web dev tool, on initial load, the POST form doesn't include my modal fields.
Code:
<form action="/" method="POST" name="SubmitForm">
<input name="IWBUTTONCARD_CARD1" type="hidden">
<input name="IWBUTTONCARD_CARD2" type="hidden">
<input name="IWBUTTONCARD_CARD3" type="hidden">
<input name="IW_FormName" type="hidden" value="IWFormHome">
<input name="IW_FormClass" type="hidden" value="TIWFormHome">
<input type="hidden" name="IW_width" value="">
<input type="hidden" name="IW_height" value="">
<input type="hidden" name="IW_Action" value="">
<input type="hidden" name="IW_ActionParam" value="">
<input type="hidden" name="IW_Offset" value="">
<input type="hidden" name="IW_SessionID_" value="tGAet75DtyqOHB5pLq-eK96L8fa">
<input type="hidden" name="IW_TrackID_" value="1">
<input type="hidden" name="IW_WindowID_" value="wid=7hnzp6-9Ihje8~HpVTG8f249ilS">
<input type="hidden" name="IW_Location_" value="http://localhost:8888/">
</form>

When I open the modal, its fields are added at the end of the POST form.
Code:
<form action="/" method="POST" name="SubmitForm">
<input name="IWBUTTONCARD_CARD1" type="hidden" tabindex="-1">
<input name="IWBUTTONCARD_CARD2" type="hidden" tabindex="-1">
<input name="IWBUTTONCARD_CARD3" type="hidden" tabindex="-1">
<input name="IW_FormName" type="hidden" value="IWFormHome" tabindex="-1">
<input name="IW_FormClass" type="hidden" value="TIWFormHome" tabindex="-1">
<input type="hidden" name="IW_width" value="" tabindex="-1">
<input type="hidden" name="IW_height" value="" tabindex="-1">
<input type="hidden" name="IW_Action" value="" tabindex="-1">
<input type="hidden" name="IW_ActionParam" value="" tabindex="-1">
<input type="hidden" name="IW_Offset" value="" tabindex="-1">
<input type="hidden" name="IW_SessionID_" value="tGAet75DtyqOHB5pLq-eK96L8fa" tabindex="-1">
<input type="hidden" name="IW_TrackID_" value="2" tabindex="-1">
<input type="hidden" name="IW_WindowID_" value="wid=7hnzp6-9Ihje8~HpVTG8f249ilS" tabindex="-1">
<input type="hidden" name="IW_Location_" value="http://localhost:8888/" tabindex="-1">
<input name="IWEDITDATE_IWFRAMEMODAL_CARD2" type="hidden" tabindex="-1">
<input name="IWBUTTONVALIDATE_IWFRAMEMODAL_CARD2" type="hidden" tabindex="-1">
<input name="IWBUTTONCLOSE_IWFRAMEMODAL_CARD2" type="hidden" tabindex="-1">
</form>

And after the 1st validation, the POST form is refreshed and my modal fields are at the beginning of the form.
Code:
<form action="/" method="POST" name="SubmitForm">
<input name="IWBUTTONCARD_CARD1" type="hidden">
<input name="IWEDITDATE_IWFRAMEMODAL_CARD2" type="hidden">
<input name="IWBUTTONVALIDATE_IWFRAMEMODAL_CARD2" type="hidden">
<input name="IWBUTTONCLOSE_IWFRAMEMODAL_CARD2" type="hidden">
<input name="IWBUTTONCARD_CARD2" type="hidden">
<input name="IWBUTTONCARD_CARD3" type="hidden">
<input name="IW_FormName" type="hidden" value="IWFormHome">
<input name="IW_FormClass" type="hidden" value="TIWFormHome">
<input type="hidden" name="IW_width" value="">
<input type="hidden" name="IW_height" value="">
<input type="hidden" name="IW_Action" value="">
<input type="hidden" name="IW_ActionParam" value="">
<input type="hidden" name="IW_Offset" value="">
<input type="hidden" name="IW_SessionID_" value="f8bqraYO4OWixO5mSQtdf~3mfoa">
<input type="hidden" name="IW_TrackID_" value="3">
<input type="hidden" name="IW_WindowID_" value="wid=1TTMn6qkaYOMPbLoPIuchx6~DGi">
<input type="hidden" name="IW_Location_" value="http://localhost:8888/?IWEDITDATE_IWFRAMEMODAL_CARD2=2023-08-15&amp;IWBUTTONVALIDATE_IWFRAMEMODAL_CARD2=Validate">
</form>

The position of the inputs in the form (before and after the hidden inputs) can have any impact in an intraweb application.

I cleaned my cache, just to be sure, and rebuild the app several times, but not working.
I also tried again the workaround, no result for me.


RE: Problem to create a modal form - Alexandre Machado - 08-07-2023

I'm not sure what you are doing different. This is the application the same way I downloaded it, built with the new release:

   

I can't detect any misbehavior and the URL looks correct to me


RE: Problem to create a modal form - StephB - 08-08-2023

I removed the date picker from the home page, but the modal part is normally the same.
Hereby I join the current version of my test app, which was used to capture the previous video after installing the new release.


RE: Problem to create a modal form - Alexandre Machado - 08-08-2023

The problem with your new project is that your "Validate" button, on the popup frame, is marked as a submit button in the modal.html template:

{%IWButtonValidate type="submit"%}

Remove the submit type and it will work. You should never set submit buttons yourself or it will break IW functionality as you can see here. IntraWeb handles the posting of forms via it's own Javascript.


RE: Problem to create a modal form - StephB - 08-09-2023

My mistake, I totally forgot this try. After removing this useless form and submit from my template, everything works fine now.

Many thanks for your help, see you.