Form Calculations: Calculate time shift and hide the other questions.

  • SAL105
    Asked on April 17, 2024 at 1:04 PM

    What I am looking for: if submitter enters their start shift and end shift times, and the calculation of the difference is less than 15 hours, the remainder of the questions hide and a statement displays instead reading “your shift hours do not permit a nap”. Cancel submission.

    If they enter their start shift and end shift times, and the calculated difference is 15 or more hours, the remainder of the questions display and they can submit the request.


  • Camila JotForm Support
    Replied on April 17, 2024 at 1:52 PM

    Hi Sandy,

    Thanks for reaching out to Jotform Support. I suggest using Form Calculations and Show/Hide Field Conditions. Let me show you how to do it:

    1. In your Form Builder, go to Form Elements on the left side of the screen.
    2. Select the Time to add it to your form.
    3. Click Properties.
    4. On the Time Properties, select Range.
    5. Click the Toggle Button to enable the Time Range.
    6. Select the Toggle Button to enable the Duration Indicator.
      Form Calculations: Calculate time shift and hide the other questions Screenshot 80
    7. Next, click Widgets.
    8. Select Form Calculation to add it to your form.
    9. Click the Wand Icon to go to Widget Settings.
    10. Select Add Field and click Time Shift.
      Form Calculations: Calculate time shift and hide the other questions Screenshot 91
    11. Go to Form Elements again to add the Paragraph.
      Form Calculations: Calculate time shift and hide the other questions Screenshot 102
    12. Now, go to Settings.
    13. Select Conditions on the left.
    14. Click Show/Hide Field.
      Form Calculations: Calculate time shift and hide the other questions Screenshot 113
    15. Please copy the Conditions below:
      Form Calculations: Calculate time shift and hide the other questions Screenshot 124
      Form Calculations: Calculate time shift and hide the other questions Screenshot 135

    Please check out the screencast below:

    Form Calculations: Calculate time shift and hide the other questions Screenshot 146

    You can check out this Demo Form so you can try it by yourself. If you want to clone the form, you can check out this guide about How to Clone an Existing Form From a URL.

    You can check this guide about How to Show or Hide Fields Conditionally.

    We also have a guide about How to Perform Calculations Using a Widget that you can check out.

    Let us know if there’s anything else we can help you with. 

 
Your Answer