简体   繁体   中英

MVC ClientSide date validation

I'm using xVal and jQuery for clientside form validation in MVC.

A date field annotated with [DataType(DataType.Date, ErrorMessage=...)] is being properly validated if the user types a string that does not fit into the designated format. But if the user types something with invalid month or day, eg, 13/32/2010, it is not validate until submission to the server.

Does anyone know of any quick way to more robustly validate dates on the client side?

You are using xVal and looking for client side validation? Always check newest release changes. Similar post

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM