I am using the CFINPUT tag to add a date to my database, the date format in my table is YYYY-MM-DD, and cfinput just validates this formats MM-DD-YYYY and DD-MM-YYYY. What I can do to make sure that the user is entering the right format? please help me
You'd probably have to write your own javascript validator.
This is all CFINPUT really does anyway... so, if you don't know a lot about javascript, one method would certainly be to build the page with the CFINPUT validating to MM-DD-YYYY, open it in your browser and view source, copy the javascript and the now *INPUT* tag, paste the javascript back into your code then adjust it to validate the format you want (should be fairly easy).
Then replace the CFINPUT in your code with the INPUT you copied from the view source. It should have the newly revised function already called from a onX event.
Reload the page in your browser, and you should be in business.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.