Set limit for time within date picker field

  • OndaGuey
    Asked on June 27, 2019 at 2:52 PM

    Could you please make it so that limits can be applied to the available times, so that it might not be the full 24 hours that are available? This way I could limit entries to be after 8am and before 10pm or something similar. Since you already have a similar filter on the Number form element it seems like a simple addition.

    1561661486limitentrybutton Screenshot 10

    Please please please add a similar feature to the Time selection of the Date Picker.

  • Richie JotForm Support
    Replied on June 27, 2019 at 3:34 PM

    To clarify, do you want to add a limit on the quantity of items?

    You may use the Gift registry or the inventory widget .

    https://widgets.jotform.com/widget/gift_registry

    https://widgets.jotform.com/widget/inventory

    However, these widgets will not be affected by the date picker field.

    To clarify, do you want the date picker field to hold options?

    Can you please explain further how you want to use the date picker field?


    Looking forward for your response.        

  • OndaGuey
    Replied on June 27, 2019 at 3:50 PM

    That is not what I am asking for at all. Can you please read my request again? I want to create floor and ceiling caps for the times available in the Time portion of the Date Picker. To be clear I am not talking about selecting any sort of inventory, or using any other form element or widget than the Date Picker. Instead of 12:00am-11:59pm being available, I want to be able to make it 8am-10pm, or 4pm-7pm. I want to be able to control the window of time available for someone filling the form to be able to select in the Date Picker form element


  • John Support Team Lead
    Replied on June 27, 2019 at 4:41 PM

    Thank you for the information that you provided.

    I have created a feature request ticket and sending it to our back-end team. Please be noted that creating a feature request ticket does not ensure that the feature will be implemented. It completely depends upon the feasibility and priority of our developers. We will get back to you as soon as an update is available.

  • OndaGuey
    Replied on July 6, 2019 at 4:20 PM

    Any progress?

  • Mike
    Replied on July 6, 2019 at 5:28 PM

    The ticket is still open, but the priority is rather low. This is not likely that the request will be implemented in the nearest time.

    If you can set time in 24-hour format, we can show you how to hide specific hours with injected CSS.

    Set limit for time within date picker field Image 1 Screenshot 20

  • OndaGuey
    Replied on July 7, 2019 at 4:03 PM

    I do have it set to 24 hour mode. the form is https://www.jotform.com/build/91875587472171#preview

  • David JotForm Support Manager
    Replied on July 7, 2019 at 6:33 PM

    I could not find a way to do it through CSS injection, however, this can be done through the source code: https://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form

    2017 02 19 19 Screenshot 10

    Please paste the source code in a text editor, and find time fields, then put the following CSS code on the options you want to hide: style="display:none;"

    Example:


     1562538669code Screenshot 21

    Result:

    1562538774available Screenshot 32

    Note when using the Source Codes: Every time you change (add or remove fields) from your form in the form builder, you must update the form codes on your site by re-embedding the form. This is because the source codes that are currently embedded to your page are not automatically updated. 

    Let us know if you need more help.

  • OndaGuey
    Replied on July 7, 2019 at 7:09 PM

    That is an interesting work around, however I have to work with an iFrame, not the source code.

     

    Perhaps Mike's method will work?

  • AndrewHag
    Replied on July 8, 2019 at 1:46 AM

    Do you wish to set the limit on the field below?

    1562564542Onda Güey Courier Rate Genera Screenshot 10

    If yes, please try the CSS code below:

    #hour_77 option[value="00"],option[value="01"],option[value="02"],option[value="03"],option[value="04"],option[value="05"],option[value="06"],option[value="07"],option[value="23"]

    {

      display: none !important;

    }

    1562564743chrome RvdutFDwJa Screenshot 21

  • Mike
    Replied on July 8, 2019 at 6:10 PM

    For example, if you would like to hide specific hours for some Date Picker field, based on Andrew's example, you can check the hour field ID in the field details.

    Set limit for time within date picker field Image 1 Screenshot 30

    Then, use it in CSS like this:

    #hour_77 option[value="00"],
    #hour_77 option[value="01"],
    #hour_77 option[value="02"],
    #hour_77 option[value="03"],
    #hour_77 option[value="04"],
    #hour_77 option[value="05"],
    #hour_77 option[value="06"],
    #hour_77 option[value="07"],
    #hour_77 option[value="23"] {
    display: none !important;
    }

    Also, it looks like you need a closing curly bracket } after your @media query.

    Set limit for time within date picker field Image 2 Screenshot 41

  • OndaGuey
    Replied on July 8, 2019 at 6:23 PM

    YES! THANK YOU! That was exactly what I needed!