开发者

jquery - day month year validation

开发者 https://www.devze.com 2023-01-20 14:19 出处:网络
I\'m having separate select boxes for day, month, year validation. 12 ... JanFeb ... 20092010 ... If I use jquery validation plug-in, it displays separate error messages for each fields if it no

I'm having separate select boxes for day, month, year validation. 12 ... JanFeb ... 20092010 ...

If I use jquery validation plug-in, it displays separate error messages for each fields if it not selected.

But I want to treat all the three as a single field, and display error message. if day is selected and month and year are not selected. then the error message would be please select a month. if day and month are selected then it 开发者_如何学Pythonshould be please select the year etc.


Why don't you try using the datepicker function of jQuery-UI? You can have an alternate field that show the date in the format you want (so you can parse it in case you want more validation) and another field so you can show a user friendly format.

http://jqueryui.com/demos/datepicker/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号