Conditions in the postcode field

  • mrborry
    Asked on December 2, 2014 at 8:16 AM

    Hi,

    I am doing a booking form that should only allow customers within a certain area. Specifically the DT1, DT2, DT3, DT4 & DT5 areas. Can you advise me the best way to accomplish this?

     

    Kind Regards

     

  • Charlie
    Replied on December 2, 2014 at 9:52 AM

    Hi,

    Upon checking your form, I've cloned it for testing purposes. 

    Here is my cloned form: http://form.jotformpro.com/form/43354005194954.

    What it does is when the Postcode field is not DT1, DT2, DT3, DT4 or DT5 the submit button will not show up.

    This is how I made the changes:

    1. I remove the Postcode field in the Address field.

    Conditions in the postcode field Image 1 Screenshot 60

    2. I then added a textbox that will act as the Postcode field.

    Conditions in the postcode field Image 2 Screenshot 71

    3. I'll add a condition to where when the rule is met it will show the submit button. 

    Conditions in the postcode field Image 3 Screenshot 82

    4. In this condition it will only accept inputs equal to DT1 to DT5.

    Conditions in the postcode field Image 4 Screenshot 93

     

    5. After that, I will add a custom CSS code to hide the main label so that the sublabel will be the only one shown.

    Here's the code:

    #label_22 {

    display:none;

    }

    Conditions in the postcode field Image 5 Screenshot 104

     

    You can also clone my form using this guide: http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL 

     

    I hope this helps. Let us know if you need further assistance on this.

    Thank you.

  • mrborry
    Replied on December 2, 2014 at 10:00 AM

    Hi,

     

    Thanks for the quick response, its nearly exactly what I need, but the DT1-DT5 is just the pre-requisite. So for example: The user would type something like DT40ED, not just DT4. 

    I need it so anyone in the catchment area of the DT1-DT5 areas can finish the postcode off with whatever extension they have

    Hope that makes sense

     

    Kind regards

  • Charlie
    Replied on December 2, 2014 at 10:50 AM

    Hi,

    If that's the case, we'll just need to change the condition's rule from "Equal To" to "Contains".

    Here's the screenshot of my conditions:

    Conditions in the postcode field Image 1 Screenshot 20

     

    When the user types anything with the DT1-DT5 on the PostCode, it will allow the users to submit the form.

    You can also explore the different rules in the Conditions settings, aside from "Equal To" and "Contains" you can also use "Starts With".

    You can check again the cloned form I have, it should be updated right now. 

    Thank you.