Highlighted

[CF10] CFINPUT custom validation start and end dates

LEGEND ,
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

139

Likes

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

[CF10] CFINPUT custom validation start and end dates

LEGEND ,
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

140

Likes

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
Nov 05, 2014 0

Have something to add?

Join the conversation