Hello Folks,
First, chronoforms has been really helpful. Thank you Chronoforms!
After some hours spent googling and a great deal of trial and error, I thought it would be helpful to share this challenge. Hopefully, someone else has encountered this issue or knows how to fix it.
I have a multi page form and every page has a lot of conditional questions. One of the pages has a final question that is connected to an event switcher. Depending on the user's answer, either the following page in form is loaded or the same page is loaded again.
The problem is when the same page is loaded again, all the fields still have the original values, and fields that were previously hidden are now shown. I want the page to display the same way it did when it was initially loaded (certain fields hidden, everything with null/default values). I am using javascript to control when fields display and are mandatory (i followed the instructions here to do so http://greyhead.net/chronoforms/chronoforms-adding-an-other-box-to-a-drop-down).
Any assistance is much appreciated!
First, chronoforms has been really helpful. Thank you Chronoforms!
After some hours spent googling and a great deal of trial and error, I thought it would be helpful to share this challenge. Hopefully, someone else has encountered this issue or knows how to fix it.
I have a multi page form and every page has a lot of conditional questions. One of the pages has a final question that is connected to an event switcher. Depending on the user's answer, either the following page in form is loaded or the same page is loaded again.
The problem is when the same page is loaded again, all the fields still have the original values, and fields that were previously hidden are now shown. I want the page to display the same way it did when it was initially loaded (certain fields hidden, everything with null/default values). I am using javascript to control when fields display and are mandatory (i followed the instructions here to do so http://greyhead.net/chronoforms/chronoforms-adding-an-other-box-to-a-drop-down).
Any assistance is much appreciated!
Hi h311idunno,
Since you are using custom JS to control the fields visibility, then you can check the submit button status when the page loads, and hide them, you can use PHP code with tags in the "Load JS" action.
I hope this helps!
Regards,
Max
Since you are using custom JS to control the fields visibility, then you can check the submit button status when the page loads, and hide them, you can use PHP code with tags in the "Load JS" action.
I hope this helps!
Regards,
Max
I tried passing the status of the submit button and then reading it with the js but no luck. It's like the 2nd time the page loads nothing in the JS function window.addEvent('domready', function() {//code here}; is getting executed. Should I be using a different function to identify when the page finishes loading?
I figured it out finally. Forgot to add JS on the event switcher. It was only loading the JS the first time the page loaded and not the 2nd time.
If the js is added to some event X and you reload the page using an "event loop" pointing to event X then the js should reload!
Regards,
Max
Regards,
Max
Thanks Max! That is exactly what I needed. It seems relying on the event switch alone without the event switch was the cause of some other bugs too. Dropped the event loop in the switch and it works like a charm.
This topic is locked and no more replies can be posted.
