- MarkAsked on March 01, 2012 at 10:56 AM
I have a textbox that is prepopulated using a request parameter. The textbox is only shown when a certain drop down value is selected.
It works fine if the user selects the correct drop down value. Here the textbox is shown and is prepopulated. However if the user then selects a different drop down value (hiding the textbox) and then reverts to the first choice the textbox value is gone.
This also happens if the user selects a drop down value first which doesn't show the textbox. If the user then selects a value which displays the textbox the prepopulated value is missing.
Is this a bug or am I doing something wrong?
- JotForm SupportNeilVicenteAnswered on March 01, 2012 at 07:05 PM
This is not a bug. When a field gets hidden, it is then considered as a non-part of a form and is therefore cleared of user-entered values (including values passed using URL parameters)
If you'd like a field involved in conditions to be prepopulated, you must use the Default Value option instead of passing a value using URL parameters.
- MarkAnswered on March 02, 2012 at 06:22 AM
Thanks for your quick response.
This behaviour seems a bit strange. If the field is not considered part of the form when it gets hidden why is the prepopulated value present for the first showing of the textbox? The field starts off as hidden and the value is present when the field is shown for the first time. It only gets removed after it is hidden and then shown again.
- JotForm SupportNeilVicenteAnswered on March 02, 2012 at 07:45 AM
That is because the scripts for show/hide conditions trigger only on user initiated actions and default value configuration.
Try setting your dropdown box's value (using URL parameters) to the option that will show your prepopulated textbox and you will see what I mean.
- MarkAnswered on March 02, 2012 at 08:06 AM
So just to confirm it's the condition firing that's clearing the prepopulated value when the field is hidden?
In that case why does it not clear the field when the form is first displayed? When it's first displayed the default value is not the one that shows the hidden field so the form hides the prepopulated field. I created a form below that illustrates this.
By your logic the prepopulated field should be blank because a condition has fired which hides the 'prepopulated' field. However when Option 1 is chosen the prepopulated value is present.
- JotForm SupportNeilVicenteAnswered on March 02, 2012 at 09:02 AM
Yes, it is the hide condition triggered by user action (i.e, manually selecting the dropdown option) that clears the field value.
- MarkAnswered on March 02, 2012 at 09:34 AM
Thanks for clearing that up.
I do think however that JotForms shouldn't be doing this. Either fields hidden by CSS should be blanked in all circumstances or they should be left alone. For my particular use case I don't want the hidden fields cleared in any scenario.
Take for example the situation where the user fills out a large number of fields that are only displayed if a select list option is chosen. If the user then changes that option (which hides the fields) and then reverts to their original choice all the fields will be blanked. This isn't 'normal' HTML form behaviour.
Ideally the clearing of hidden fields should be a feature that's able to be deactivated somewhere in the form settings. Is there any chance of this being added in the future?
- JotForm SupportMike_TAnswered on March 02, 2012 at 06:50 PM
I have forwarded your inquiry to our Development Team, but I can not say when or if it will be processed.
In the meantime, please use the Default Value option as suggested by Neil, if possible.
Thank you for using our services.
- serkanAnswered on March 05, 2012 at 08:03 AM
I've changed the prepopulation behaviour. They will act like default values now. It makes more sense and fixes your problem.
- registerbroadbandAnswered on March 12, 2012 at 11:27 PM
Is it fixed now? Because I also want to use hidden box to store some value from from jotform arguments?
- JotForm SupportmlizAnswered on March 13, 2012 at 12:30 AM
The ticket related to this issue has already been marked as fixed. As what serkan posted the prepopulation behaviour has been updated.
- rayjAnswered on November 07, 2012 at 12:59 PM
If I understand the posts above, the problem still exists. For instance, create a simple form with two fields, one for a trigger and the other to be shown/hidden. If the condition to show the field is met the "display" field is visible. Enter a value in that field and then clear and resest the trigger. The "display" field is empty.
- JotForm SupportEduardoMendezAnswered on November 07, 2012 at 02:17 PM
We'll be glad to assist you!
However, I am having difficulty understanding the question.
Can you please try to expand on it?
I'll be waiting for your response!