Is there a way I can limit the date in expiration date field

  • amirw1962
    Asked on April 1, 2018 at 7:49 PM

    Hello,

    I have 2 dates fields.

    First field: Insurance start date

    Second field: Insurance expiration date.

    Naturally, the second date field can't be earlier than the first field. Expiration date will always come after start date....

    Is there a way I can limit the values in expiration date field so that the expiration date can't be before the start date? (Or even better: The expiration date can't be earlier than start date + 30).

    Alternatively, I tried to add a Javascript form validation function and add to the form action line something like:
    onDISABLEDsubmit="return validateForm()" name="form3" , for example, but when I clicked the submit button, the function wasn't processed and the form submitted without taking into account the condition in the function.

    Any solution to above situation?

    Best Regards,

    Amir

  • John_Benson
    Replied on April 1, 2018 at 8:53 PM

    Yes, you can limit the date in the Expiration Date field. To do that, please follow this guide:

    1. Open the form in the Form Builder.

    2. Select the Expiration Date field and click the Properties icon.

    3. Go to the Limits tab and configure the Start and End Date feature.

    1522630141Date 0024 Screenshot 10

    Here's a demo form: https://form.jotform.com/80907516755969

    I hope this helps. Please contact us again if you need further assistance.

  • giftcardbuddy159
    Replied on April 2, 2018 at 2:10 AM

    I just can't believe how horrible this guy John_Benson is at answering questions. He literally NEVER understands what the person wants... I think he might just be a bot that just answers questions based on keywords... If not, WOW... come on jot forms... get an employee who actually fully reads peoples questions. 

    Anyways... this will work... the only thing is, is that the fields HAVE to be the date picker fields.

    Okay on when you're editing your form see where it says Build, Settings, and publish?

    Hit settings.

    Then on the right do you see where it says form settings, conditions, emails, intergrations, thank you page?

    Hit conditions.

    Then hit the + sign in the box at the top.

    Then select Hide/Show fields.

    Enter this into the fields:

    If: Second field: Insurance expiration date.

    State: Before 

    Target: Another field

    Field:  First field: Insurance start date


    Do: Hide

    Field: (Select your Submit button)

    *Optional: [Now hit the plus sign next to the box that has the above 2 questions]

    Do: Show 

    Field: (Create a "field" that is simply text saying something like "Your expiration date is prior to your start date. Unfortunately, your insurance is expired and we cannot..."  This will work as an error message.)


    Then hit save.


    This should make it so if the 2nd date is before the first then the submit button will hide, making it so they cannot submit the form. Also an error message will show, making it so they know what's wrong.


    The ONLY thing is, is the fields have to be the Date Picker Fields. 

     

  • amirw1962
    Replied on April 2, 2018 at 2:50 AM

    Thank you so much for the very clear explanation, I really appreciate it!
    Now I can see how versatile and flexible the system is and I really can use it to take care of all situations.

    Thanks again!