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

    Preventing Required fields if hidden via conditional logic

    Asked by charitychallenge on November 05, 2014 at 06:10 PM

    I have a radio button choice:

    Male/Female

    Dependent upon the selection, one or another dropdown field is hidden or appears with Shirt Size choices (obviously Men's size choice dropdown field for Male, or Ladies size choice dropdown field for Female). 

    I need to make the Dropdown size field choice Required/Mandatory, but only subject to the Gender that was selected.  Obviously, if Male is chosen, I need the Men's shirt size choices only to show and to force a minimum of one size selection and therefore keep the Ladies Shirt size dropdown hidden and not force a selection of one of these - and vice versa.

    At present, if I make both Dropdown fields required to ensure a size is selected, this appears to override the condition to Show/Hide if the other Gender is selected.

    I'm sure there is another way around this, or maybe it should work and I have simply not implemented or tested properly.

    Hope I have clearly explained.

    The example I have included presently has the Male and Female Shirt Size dropdown fields each set to required.

    Page URL:
    https://secure.jotformpro.com/form/43086707878974

    hidden dropdown field size Selection
  • Profile Image
    JotForm Support

    Answered by Charlie on November 05, 2014 at 08:39 PM

    Hi,

    I'm not sure if I understood you correctly, but upon checking you account it seems that there are some conflicts with your condition. I've cloned it and made a couple of changes, you can check the screenshot below as a quick guide and demo.

    1. I added a condition to show the "Polo Shirt Size" field for Male when the "Gender" field selected is "Male", then same with the female condition. I disabled your conditions that hide the fields because this will conflict with the ones I created.

    2. Here's the URL of the cloned Form that I edited:

    http://form.jotformpro.com/form/43087530538962 

     

    See if the changed that I made is the one that you are looking for or you want to achieve.

    Let us know if this works for you.

    Thank you.

     

     

  • Profile Image

    Answered by charitychallenge on November 05, 2014 at 08:54 PM

    Thank you - you did understand my question

    Your answer is fine but I have one other related question.

    In my example, if I accidentally choose Male and set shirt size to XL, but then change to Female and set shirt size to S, the Male Shirt Size field will still have a value in it (won't it?).

    Is there a way I can set (in this example) the Male Shirt Size to null if Female gender is chosen, or vice versa?

    Thanks

  • Profile Image
    JotForm Support

    Answered by ashwin_d on November 05, 2014 at 10:06 PM

    Hello charitychallenge,

    In my example, if I accidentally choose Male and set shirt size to XL, but then change to Female and set shirt size to S, the Male Shirt Size field will still have a value in it (won't it?).

    Actually if you input a value in a text box and then based on some condition if that text box is hidden, data will not be saved of that text box.

    You can test it yourself in your form. If you select Male and select the shirt size, change the gender selection to female, select the female shirt size and submit form - dropdown value of the male shirt size will not be saved.

    Hope this answers your query.

    Do get back to us if you have any questions.

    Thank you!

  • Profile Image

    Answered by charitychallenge on November 05, 2014 at 10:48 PM

    Yes - thanks, I saw this was the case.  Great.

  • Profile Image
    JotForm Support

    Answered by ashwin_d on November 05, 2014 at 11:16 PM

    Hello charitychallenge,

    You are welcome.

    Do get back to us if you have any questions.

    Thank you!