How to validate between two time ranges in a Time widget

  • Profile Image
    dhineshestfnsw
    Asked on August 25, 2020 at 02:32 AM

    In a Time widget we can set "TO" time in Range settings, But there is no validation between From time and To time. Please see the screenshot attached. Getting solution ASAP will be more helpful.

    Screenshot
  • Profile Image
    Anita_K
    Answered on August 25, 2020 at 07:27 AM

    Hi,

    thank you for reaching out to us.

    Is this the form in question? https://www.jotform.com/201910629957058

    Can you please elaborate on the issue? I have tested the form, and it didn't let me submit it unless the second field "To" was also filled. Is this the issue you are experiencing?

    Looking forward to your reply.

  • Profile Image
    Anita_K
    Answered on August 25, 2020 at 10:35 AM

    Hi,

    thank you for clarifying. This can be achieved by adding a few extra fields and a couple of conditions.

    I've created a demo form for you, that you can check out here and you can also clone this to take a look at the conditions.

    1. First, we need to separate the output of the Time Field by using two Substring Widgets:

    2. Since the output of the Time field is text, we need to turn it into numbers, using two Calculation fields and two conditions:

    3. You can also add a Paragraph field to serve as an error message, this is optional.

    4. Finally, you can set up the condition that hides the Submit button if the "To" time is earlier than the "From" time

    Please give this a go and let us know how it goes.