Validating date using javascript

posted by | Leave a comment

but if you want to do it in .net, its very easy, take the difference between the 2 Date Time objects, and it will return you a Time Span object, then just check the Time Span object's 'Days' property....Sunil -----Original Message-----Hi, I have two input fields on an ASP Page. I want to check that the difference in months does notexceed 360 months. Is this possible in Javascript to get the difference in months? I think you should post this query in some javascript newsgroup.... I want to check that the difference in months does not exceed 360 months.If the required format is not used, an alert dialog describes the nature of the error in text.This may be accomplished through scripting created by the author (see, for example, SCR18: Providing client-side validation and alert).

For an alternative approach to client-side form validation, without Java Script, check out our new article on HTML5 Form Validation which is available now in most modern browsers.

Only when all conditions have been satisfied do we reach the command, in which case the form will be submitted.

You'll see that the all validation scripts presented on this and subsequent pages adhere to the same basic format.

When form input is important, it should always be verified using a secure server-side script.

Otherwise a browser with Java Script disabled, or a hacker trying to compromise your site, can easily submit invalid data. The first test in the example is therefore only necessary in order to provide a different error message when the input is blank.

Leave a Reply

dating for people with depression