Question
CFINPUT Datefield Type Validation
I've set up a <cfinput> with type="datefield". I'd like
to have it work if the field is empty but would also like to
valdidate an entry if made. Here's the code I am using:
<cfinput type="datefield" name="anniversary" value="#SelectAssociate.anniversary#" required="no" validateat="onSubmit" validate="date" message="Please enter the date as MM/DD/YYYY">
When I try and submit the form with the field empty I get the following error:
The value '' cannot be converted to a number.
This validates just fine if an entry is made both valid and invalid entries.
Can I accomplish my goal? If so what am I doing wrong?
Thanks.
<cfinput type="datefield" name="anniversary" value="#SelectAssociate.anniversary#" required="no" validateat="onSubmit" validate="date" message="Please enter the date as MM/DD/YYYY">
When I try and submit the form with the field empty I get the following error:
The value '' cannot be converted to a number.
This validates just fine if an entry is made both valid and invalid entries.
Can I accomplish my goal? If so what am I doing wrong?
Thanks.