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

    Conditional trigger to toggle form elements between optional and required

    Asked by mioswebdesigns on January 29, 2013 at 11:48 AM

    Hi there,

    I'm building a form and I have a radio button form element with two options; yes or no. I also have various other elements in my form that preceed this yes or no radio button element. What I want to do is create a conditional statement in my form, where if the user selects "yes" then all the form other elements become optional elements to fill out, and if they select "no" all the other form elements become REQUIRED elements.

     

    I included the link to my form http://form.jotform.us/form/23527467501150

    Basically the question "Are you a Health Care Provider?" with choices "Yes" or "No" is where I need the conditional trigger. If user selects Yes, then all other form elements that come after that question can toggle to optional. If user selects No, then all other form elements that come after that question can toggle to required.

     

    Thanks for you help!

    Page URL:
    http://form.jotform.us/form/23527467501150

  • Profile Image
    JotForm Support

    Answered by jonathan on January 29, 2013 at 01:08 PM

    Hi,

    There is really no condition property that will make a field required or not -- using the form builder.

    You can probably do it using the form's source code and inject your own funciton code that make a field required/not required on a given logic condition.

    There is a workaround without resulting to using the form's source code -- but this not making a field required/not required (it only gives that illusion). You can review the details on this discussion thread -Making-a-field-required-depending-on-previous-answer . Specifically, it is the suggestion offered by NeilVicente.

    Hope this help. Please tell us if this work for you, or not..

    Thanks.

  • Profile Image

    Answered by mioswebdesigns on January 29, 2013 at 02:01 PM

    Hi jonathan,

    Your suggested work around worked perfectly, since I can choose which required fields to hide if "yes" is chosen. Thank you very much for the quick response and thanks also to NeilVicente for the original post.

    Regards,
    miOs™ team

  • Profile Image

    Answered by mioswebdesigns on January 29, 2013 at 02:08 PM

    Hi jonathan,

    Once I save a "Show / Hide a form field" condition in the Conditions Wizard, how do I go back in and modify that condition? I marked the fields I wanted to hide, and then noticed I need to make an adjustment to what I selected. Do I have to recreate my condition all over again? Or is there a "edit existing Show / Hide a form field" option somewhere that I'm not seeing?

    Thanks again.

  • Profile Image
    JotForm Support

    Answered by jonathan on January 29, 2013 at 02:21 PM

    Hi,

    You are probably referring to your saved conditions. Please use the visual guide below

     

    Please inform us if this is not what you were looking for.

    Thanks.