Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here iam validating texboxes of Name,Gender,City,Dateofjoining but here iam getting a error as

String was not recognized as a valid DateTime.

```

$(document).ready(function () {
$("#btncreate").click(function () {
if ( Name == "" || ddlGender == "" || City == "" || Dateofjoining == "") {
alert("All Fields Are Mandatory");
return false;
}
});
});

```
How to validate date textbox value.
Posted
Updated 5-Apr-15 4:03am
v4
Comments
[no name] 5-Apr-15 9:19am    
Check your date format i think it's may be mm/dd/yy or dd/mm/yy.

Either you can use solution of Richard by placing a date picker or if you want to verify like other of your controls then you can follow this link.

http://jqueryvalidation.org/date-method/[^]
 
Share this answer
 
Use a Datepicker/[^] control, to ensure the date will be valid.
 
Share this answer
 
Comments
Peter Leow 5-Apr-15 8:28am    
This is the right one. 5ed!
Richard MacCutchan 5-Apr-15 8:30am    
:thumbsup:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900