Monday 15 April 2013

javascript - Jquery date validation for invalid date entry -


I am implementing the jQuery date picker which can also choose keyboard entry as well as the keyboard entry. When it is selected from the calendar, then it is working fine.

  & lt; Input type = "text" id = "date" /> & Lt; Script & gt; $ ('# Date') datepic ({dateFormat: 'mm / dd / yy'}) ("Change", function () {Warning ("You entered:" + ($ (this) .datepicker ('Getdate'));})   

I have problems then, say 02/31/2014 which is invalid I want to set a custom message to the user that $ is invalid.

But Jquery is going through today's date for incorrect entries. How can I get the exact value of the user entry (02/31/2014)?

The method of JQuery when using getdate, it is automatically today's date for an invalid date Set on (make sure that's why it's lke in Jquery).

  Warning ("You have entered:" + ($ (this). Datapikar ('Get That'));   

Use this instead

  Warning ("You have entered:" + ($ ("# date"). Val ()) ;   

Update:

No comments:

Post a Comment