What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Prepopulated field value missing after textbox hidden by condition

    Asked by Mark on March 01, 2012 at 10:56 AM

    Hi,

    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?

    Thanks,

    Mark.

  • Profile Image
    JotForm Support

    Answered by NeilVicente on March 01, 2012 at 07:05 PM

    Mark,

    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.

  • Profile Image

    Answered by Mark on March 02, 2012 at 06:22 AM

    Hi,

    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.

    Thanks,

    Mark.

  • Profile Image
    JotForm Support

    Answered by NeilVicente 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.

  • Profile Image

    Answered by Mark on March 02, 2012 at 08:06 AM

    Hi,

    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.

    http://form.jotformeu.com/form/20613195678358?prepopulated=hello

    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.

    Thanks,

    Mark.

     

  • Profile Image
    JotForm Support

    Answered by NeilVicente 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.

  • Profile Image

    Answered by Mark on March 02, 2012 at 09:34 AM

    Hi,

    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?

    Regards,

    Mark.

  • Profile Image
    JotForm Support

    Answered by Mike_T on March 02, 2012 at 06:50 PM

    Mark,

    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.

  • Profile Image

    Answered by serkan 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.

  • Profile Image

    Answered by registerbroadband on March 12, 2012 at 11:27 PM

    Hi,

    Is it fixed now? Because I also want to use hidden box to store some value from from jotform arguments? 

  • Profile Image
    JotForm Support

    Answered by mliz 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.

    Thanks!

  • Profile Image

    Answered by rayj 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.

  • Profile Image
    JotForm Support

    Answered by EduardoMendez on November 07, 2012 at 02:17 PM

    Hello there!

    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!