• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[CF10] CFINPUT custom validation start and end dates

LEGEND ,
Nov 05, 2014 Nov 05, 2014

Copy link to clipboard

Copied

Hello, everyone,

Another developer that I am working with is working with a form that has start and end dates.  He'd like to be able to use custom JavaScript validation to make sure that not only are the dates in proper format (that part of the JS is working fine), but that it will also check to make sure that the start date will always be prior to (or equal to) the end date, and will throw an alert if the end date is before the start date.

I've Googled for this, and am finding informative suggestions on just making sure the date is in the right format, or falls within a certain range, but nothing on how to make sure that one date is before (or less than) another.

I'm guessing that data binding might be a part of it.  Can anyone suggest how to set these fields so that each has a validateat="onblur" that will check both values?

Also, as a related issue, he has the CF datepicker working as far as entering the dates, but since the field doesn't get/lose focus on this, how do we trigger the function?

V/r,

^_^

Views

181

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation