How to limit the time showing in a DataTime field?

  • Profile Image
    paracaidismogalicia
    Asked on June 07, 2016 at 03:56 PM

    Can I Limit Time?? I want time to display from 10:00 until 18:00.

    Is possible?

  • Profile Image
    Mike_G
    Answered on June 07, 2016 at 05:32 PM

    Yes, it is possible. With the help of CSS codes, we will hide the options from 0:00 to 9:00 and 19:00 to 23:00.

    Please check this form: https://form.jotform.com/61586587235972

    Here's the CSS code added to the form.

    select[id^="hour"].time-dropdown.form-dropdown option:nth-child(n+2):nth-child(-n+11){

    display: none !important;

    }

    select[id^="hour"].time-dropdown.form-dropdown option:nth-child(n+21):nth-child(-n+25){

    display: none !important;

    }

    Here's how it's done.

     

    How-to-Inject-Custom-CSS-Codes

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

  • Profile Image
    martinliu
    Answered on December 05, 2016 at 03:17 PM

    Hi Mike_G,

    You CSS code works well with Chrome.  but the hours limitation with your CSS doesn't work in Internet Explorer.  Could you provide the CSS for Interner Explorer as well?

     

    My form: https://www.jotform.ca/form/61805317661253?preview=true

    Thanks,

    Martin

  • Profile Image
    Jim_R
    Answered on December 05, 2016 at 05:37 PM

    Hey Martin, to give way to the OP, I have moved your question to a separate thread https://www.jotform.com/answers/1004236

    We'll have it addressed there shortly.