How can I lock the date picker option?

  • Profile Image
    aahuja1078
    Asked on August 21, 2019 at 02: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?


  • Profile Image
    Nik_C
    Answered on August 21, 2019 at 04: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.4

    End date:

    1566420346Screen Shot 2019-08-21 at 10.4

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

    Hope it helps.

    Thank you!


  • Profile Image
    aahuja1078
    Answered on August 21, 2019 at 06: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
    ...
  • Profile Image
    gerardw
    Answered on August 21, 2019 at 08:30 PM

    You have two alternatives here:

    Alternative I:

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

    15664330312208_4.png

    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.png

    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.png

    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.png

    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.png

    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.

  • Profile Image
    aahuja1078
    Answered on August 22, 2019 at 04: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
    ...
  • Profile Image
    Nik_C
    Answered on August 22, 2019 at 06: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.3

    Is that what you wanted?

    Please advise.

    Thank you!

  • Profile Image
    aahuja1078
    Answered 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
    ...