How can I lock the date picker option?

  • aahuja1078
    Asked on August 21, 2019 at 2:59 PM

    I want to lock the date picker option whereby there are two date pickers as I am using for a hotel submission.

    the first is for arrival date and should only show the month of June 2020, and the departure date picker should show June 2020 and July 2020.


    I know there is a way to do it but I tried disabling the custom date range but having no luck, any ideas?


  • Nik_C
    Replied on August 21, 2019 at 4:47 PM

    If you want to have those date specifically, you can use Date picker field and Limits section, for example:

    Start date:

    1566420369Screen Shot 2019 08 21 at 10 Screenshot 10

    End date:

    1566420346Screen Shot 2019 08 21 at 10 Screenshot 21

    Here is the test form: https://form.jotform.com/92326828556972

    Hope it helps.

    Thank you!


  • aahuja1078
    Replied on August 21, 2019 at 6:43 PM
    Thanks for the help, but I wanted to go one step further, when you click on
    the calendar icon, I want it to automatically start in June 2020. It
    currently still starts in Aug 2019 and the user has to click till June but
    I need the calendar to start in June 2020 so they dont need to click.
    is that possible?
    Ateet Ahuja
    Complete Getaways
    "Creating Ridiculously Memorable Vacations"
    877-530-5560
    mailto:info@completegetaways.com
    www.completegetaways.com
    Ateet Ahuja - Ranked within Top 175 Romance Travel Sellers
    ...
  • Girish JotForm Support
    Replied on August 21, 2019 at 8:30 PM

    You have two alternatives here:

    Alternative I:

    You can try using the Date Picker widget in the form.

    15664330312208 4 Screenshot 10

    Alternative II:

    You can show the Arrival date from June 2020 onwards using conditional logic. To achieve this, I created one date field named as the Today's Date. I then created a text field and called it Date String 1 (this will hold the string value of the current date). 

    On Today's Date field, I set the default date to be today's date:

    15664332022208 5 Screenshot 21

    I then created the following condition, to get the string value of today's date, and save it in the Date String 1 field:

    15664332892208 6 Screenshot 32

    Finally, I created the last condition to add the number of days to the current date, as follows and directed the result to the Arrival date field in the form:

    15664333722208 7 Screenshot 43

    Related Guides for reference:

    Using mathematical functions like DateString - Form-Calculation-Math-Function-Reference 

    Using conditions - How-to-Insert-Text-or-Calculation-into-a-Field-Using-Conditional-Logic 

    Here's how the form would look like after setting this up:

    15664335402208 8 Screenshot 54

    The field's Today's date and Date String 1, will need to be hidden in the form. A similar method can be achieved for the Departure Date field as well to start from June 2020.

    Here's a cloned demo form - https://form.jotform.com/92327638941970 

    You could clone it and use if required - How-to-Clone-an-Existing-Form-from-a-URL 

    Hope this helps.

  • aahuja1078
    Replied on August 22, 2019 at 4:43 AM
    this got me very close!! your form starts at 5/30. is there a way to ensure
    that the calendar open on 6/1 or 6/15?
    Ateet Ahuja
    Complete Getaways
    "Creating Ridiculously Memorable Vacations"
    877-530-5560
    mailto:info@completegetaways.com
    www.completegetaways.com
    Ateet Ahuja - Ranked within Top 175 Romance Travel Sellers
    ...
  • Nik_C
    Replied on August 22, 2019 at 6:40 AM

    You can set the custom date (if that's what you had in mind) and set it to custom one:

    1566470386Screen Shot 2019 08 22 at 12 Screenshot 10

    Is that what you wanted?

    Please advise.

    Thank you!

  • aahuja1078
    Replied on August 22, 2019 at 10:43 AM
    yes! thank you!
    Ateet Ahuja
    Complete Getaways
    "Creating Ridiculously Memorable Vacations"
    877-530-5560
    mailto:info@completegetaways.com
    www.completegetaways.com
    Ateet Ahuja - Ranked within Top 175 Romance Travel Sellers
    ...