When getting information from a user for insertion into a database, or use in other processing, it’s important to control what the user can enter.
You can find the details in Web Services using XMLHttp Request (Ajax) and related articles. It doesn't allow a space after minutes and before the am/pm example: " am" will get an invalid time. I modified the reg to the following: re = /^(\d): (\d)(:00)?
So, it makes sense the the developer should take the task of creating a function which will handle validation of date in aspects of format, number limits etc.
Through this article, you will be shown easy functional ways to make this validation.
Just be aware that it means more requests to the server which can be slower than downloading and running Java Script code.
The Ajax Request class is a simple one we've created and use on a number of projects.