Personally, I would rather use a j Query datepicker.
It turns out that regardless of the value you provide, the entity will be considered valid: Hmmm.
Since Data Type() doesn’t validate, that leaves us with two options: (1) Create our own attributes for each datatype to validate, like [Date], or (2) add validation into the Data Type attribute directly.
new Date(Element By Id("txt Completion Date").value) Sun Oct 12 UTC 0530 2014 [prototype]: Invalid Date Is there any way to specify the date format while converting value to Date type?
//First check that textboxes are not empty if($('input[id$=txt End Date]').val()=="") var end Date=new Date($('input[id$=txt End Date]').val()); var start Date=new Date($('input[id$=txt Start Date]').val()); var effct Date=new Date($('input[id$=txt Effective Date]').val()); if(end Date//First check that textboxes are not empty if(Element By Id("txt End Date").value=="") var end Date=new Date(Element By Id("txt End Date").value); var start Date=new Date(Element By Id("txt Start Date").value); var effct Date=new Date(Element By Id("txt Effective Date").value); if(end Date Using Java Script did not give any error.
Data Annotations namespace contains a validation attribute called Data Type Attribute, which takes an enum specifying what data type the given property conforms to.