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

    Can I enter multiple variables in a single conditional statement.

    Asked by scottishgroupcompanies on March 19, 2015 at 11:28 AM

    Our website, www.scottishstainedglass.com, collects leads from across the country.  We have sales people on the ground in multiple states who work through our "typical" sales process.  However in states where we do not have sales people on the ground we want a different process.  I want to be able to use a conditional statement on the zip code field to redirect users to one of 2 pages. 

    "If" the users answers one of 5000 zip codes, they go to one page, if the users answers any other zip code, they got to a different page.

    I have tried entering my list of zip codes separated by commas but that didn't seem to work.  I have been able to get it to work by entering each zip code as a single condition.  

    Is this the only way to accomplish my goal, or is there some way to possibly enter the all the variables in a single condition?

    http://www.scottishstainedglass.com/test/

    depending on zip the page either goes to http://www.scottishstainedglass.com/thank-you-for-your-interest/

    or http://www.scottishstainedglass.com/oos/

    Screenshot
    variables in different zip code www
  • Profile Image
    JotForm Support

    Answered by david on March 19, 2015 at 01:05 PM

    Hi,

    Comma separated values in your conditions are indeed possible.  Though I am not exactly sure how many entries you may have per condition.  It may only allow for up to 10 or so.  Unfortunately, I do not believe adding all 5000 to one condition is currently possible.

  • Profile Image

    Answered by dmoncrief on March 14, 2016 at 11:39 AM

    Hi 

    I have the same question. I need to have about 200 zip codes. How would the condition be built?

    I can't seem to get it to validate the comma separated values in the condition. 

    I've set the condition as 

    If 'zip' contains (zip from coma separated value)  redirect to url

    If 'zip' does not contain (zip from coma separated value) skip to page

  • Profile Image
    JotForm Support

    Answered by david on March 14, 2016 at 11:46 AM

    Comma separated values do indeed work in conditions, however, as previously stated, I believe there is a rather low limit on the number of values that can be added.  If you are trying to add all 200 to a single condition, it will not work.  I believe the maximum is 10 per condition.  For your set up, you would likely need 20ish conditions with 10 zip codes per condition.

    I set up a quick test form with a single condition and 3 values, all 3 values work as expected. 

    https://form.jotform.com/60057149779971

    Enter boot, test or created in the first text box of that form and the submit button will show.  All three values work from a single condition.

  • Profile Image

    Answered by dmoncrief on March 18, 2016 at 11:42 AM

    Thanks David,

    I tried your suggestions and it worked for the first set of 10 zip. Once I add the second set of zips, It no longer works. All zips are failing the condition. Here's an example 

    https://form.jotform.com/60774941506157

    These are the two sets of zips I started with. I need to enter more than 200. 

    30216,30169,30250,30168,30061,30127,30340,31146,30034,30038

    30233,30183,30260,30144,30062,30080,30345,39901,30035,30058

    My logic is
    If zip contains > skip to page 3
    If zip does not contain > skip to page 2

    Your assistance would be appreciated. 

     

  • Profile Image
    JotForm Support

    Answered by david on March 18, 2016 at 11:57 AM

    The conditions are currently set to "if all" conditions are met.  Since only one zip code can be entered, it is impossible for both conditions to be met:

    Change this to "if any" and the conditions should work as expected.