• Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
  • Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
home/Knowledge Base/Advanced Techniques/Compare Date fields: How to ensure that Finish Date is at least equal to *or after* Start Date, and *not* before?
Popular Search:Getting Started

Compare Date fields: How to ensure that Finish Date is at least equal to *or after* Start Date, and *not* before?

51 views 0 September 10, 2024 admin

To ensure that the Finish Date is at least equal to or after Start Date, and not before; we should follow these steps:

  1. Add a Number field to your form (Label: Difference)
  2. Go to Conditional Rules and add two rules
    1. Calculate difference between two date fields:
      1. Conditions: When both date fields are present
      2. Action: Evaluate
        differenceInMinutes({{date_2}}, {{date_1}})

        and set the result to the Difference field.

    2. Show message is difference is negative:
      1. Condition: If the value of the Difference field is negative (less than 0)
      2. Action:
        1. Disable Submit Button (e.g. Disable Element .btn)
        2. Show an alert message (e.g. Show Element #my-message)
  3. Of course, you will need to add the alert message with the Form Builder > Snippet field:
<div id="my-message" style="display:none">Finish date should be equal to or after the start date.</div>

That’s it.

Tags:conditional logicdates

Was this helpful?

Yes  No
Related Articles
  • How to embed a Form using iFrame code
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Date Formats with Dynamic Content
  • Create Users that Can Only Submit Forms

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

You must be logged in to post a comment.

Advanced Techniques
  • Compare Date fields: How to ensure that Finish Date is at least equal to *or after* Start Date, and *not* before?
  • How to embed a Form using iFrame code
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Date Formats with Dynamic Content
View All 21  
Popular Articles
  • How to Show/Hide HTML elements with Conditional Rules
  • How to enable / disable DEBUG mode
  • How to Submit a Form as WhatsApp Message
  • How to update Form Stats from the command line
  • How to compare two fields to pass the validation (jQuery Validation)
KB Categories
  • Add-Ons
  • Advanced Techniques
  • Common Issues & Troubleshooting
  • Developers "How To's"
  • Getting Started
  • How To

  Create Users that Can Only Submit Forms

Calculate the Number of Days between Two Dates  

About Easy Forms

With Easy Forms you can create unlimited web forms and most importantly the complete management of them without paying monthly fees

Resources
  • Knowledge Base
  • Documentation
  • Pre-sales Questions
  • Blog
Useful Help Links
  • Get Easy Forms
  • Live Demo
  • License Terms
  • Contact Us
Frequent Visit Links
  • Pre-Sales Questions
  • System Requirements
  • Installing Easy Forms
  • Upgrading Easy Forms
  • Privacy Policy
  • © 2015 - 2024 Baluart EIRL. All Rights Reserved.

Popular Search:Getting Started