apwbe
asked on
Date validation does not work?
I have two forms that manipulate a SQL Server database. One form creates/adds new records and the other updates the records. Each form has validation for the date fields. The form that creates/adds a new record works well and will give a message before submitting if the dates are entered in the wrong format. the code sample is:
<cfinput type="text" name="AssmApproveDate" message="Date must be mm/dd/yy format" validate="date" pattern="mm/dd/yy" value="" size="8" maxlength="8" tabindex="4">
The update form has the date values populated from the database. If no date changes are made the submit will work fine but if a wrong date format is entered or a date changed to a wrong format the validation does not work and the form is submitted resulting in a CF error for the stored procedure on the processing page that states that a the value can not be added to the DateTime field. Here is a code sample on this form:
<cfinput type="text" name="AssmApproveDate" message="Assembly Approval Date must be mm/dd/yy format" validate="date" pattern="mm/dd/yy" size="8" maxlength="8" tabindex="4" value='#DateFormat(Select_ record.Ass mApproveDa te, "m/d/yy")#'>
Any ideas why the validate will not work on this second page?
<cfinput type="text" name="AssmApproveDate" message="Date must be mm/dd/yy format" validate="date" pattern="mm/dd/yy" value="" size="8" maxlength="8" tabindex="4">
The update form has the date values populated from the database. If no date changes are made the submit will work fine but if a wrong date format is entered or a date changed to a wrong format the validation does not work and the form is submitted resulting in a CF error for the stored procedure on the processing page that states that a the value can not be added to the DateTime field. Here is a code sample on this form:
<cfinput type="text" name="AssmApproveDate" message="Assembly Approval Date must be mm/dd/yy format" validate="date" pattern="mm/dd/yy" size="8" maxlength="8" tabindex="4" value='#DateFormat(Select_
Any ideas why the validate will not work on this second page?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for you quick response to this question. I new it would be something simple but really needed a solution fast as i was under the gun.
Godd luck and thanks again!
Warren