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

    When an address field is set to required and the State/Province is not filled, 'This field is required.' is displayed even though that sub-field is op

    Asked by madhuriaddanki on December 14, 2014 at 12:40 AM

    The address field in my form needs to be required but I want the State/Province field of the Address to be optional. How can I do that?

    address field required address State/Province field State Province field not optional required sub-field required field
  • Profile Image
    JotForm Support

    Answered by abajan on December 14, 2014 at 09:17 AM

    My tests have indicated that if an address field is set to required, its State/Province "sub-field" (like the second line of the address) can be left unfilled by the user, and the form submitted. If you want to remove the State/Province sub-field, click the address field and then the Fields button in the toolbar at the top of the form builder and un-ckeck State, as shown below:


    Is this what you wanted to do?

  • Profile Image
    JotForm Support

    Answered by abajan on December 14, 2014 at 09:32 AM

    My apologies. Further tests have indicated that a jotform cannot be submitted if the State/Province "sub-field" of an address field is left unfilled. I'm actually getting inconsistent results because it seems that under some circumstances it can be left unfilled and under others it can't. I'll need to run more tests to see if I can figure out what's going on and then submit a ticket.

  • Profile Image
    JotForm Support

    Answered by abajan on December 14, 2014 at 12:24 PM

    Hi again,

    Further tests have indicated that while the behavior of the State/Province field is somewhat like that of the "Street Address Line 2" one, there are some differences:

    Scenario 1

    With the address field empty, if you click the Street Address Line 2 sub-field and then click away from it, nothing happens (which is the correct behavior because that sub-field is optional) but if the same action is taken with the State/Province sub-field (which I believe is also meant to be optional), the This field is required error is triggered:

    If at this point all of the other sub-fields are completed (or all but Street Address Line 2) and then you click away from the address field, the error message will go away. If instead of just clicking away from the address field (or clicking another field) a submission were to be attempted, the submission would be successful.

    Scenario 2

    If all but the State/Province sub-field are filled (or all but Address Line 2 and State/Province) no error message will be triggered and you will be able to submit the form in the usual manner.

    So, although I'm not 100% certain, it appears that the State/Province sub-field is just as optional as the second line of the address. It's just that the former unnecessarily triggers the error message. When I stated in my last reply that the jotform could not be submitted without the State/Province sub-field filled, it's possible that no country selection was made and I didn't realize it.

    I've submitted a ticket requesting that the State/Province sub-field work just like the Address Line 2 one but until the issue is resolved, I would suggest that the State/Province sub-field be hidden using the procedure earlier mentioned. You could always add a separate State/Province field to the form.

    Thanks

  • Profile Image

    Answered by madhuriaddanki on December 30, 2014 at 10:44 AM

    Hello Nicholas,

    Thanks for your response. I don't want the state/province field to be optional for American and Canadian addresses. If the Address fields work such that the state/province field is optional for the European addresses then that would work for me.

    Regards,

    Madhuri

  • Profile Image

    Answered by Shadae on December 30, 2014 at 11:17 AM

    Hi Madhuri,

    That is currently how the State/Province field works. If the US or Canada is select, you will get the field is required error.

    Other wise it can be left blank

    Please feel free to contact us if you need further assistance.