简体   繁体   中英

What’s a good client-side fallback for HTML5 form field validation?

I've seen many different suggestions for fallbacks for browsers who don't fully implement html5 forms (solutions involving Modernizr, YepNope, Jquery validate...) but I haven't managed to get anything to work effectively.

Essentially apart from adding a datepicker which I've managed to get going with Modernizr and JQuery datepicker all I really need to do is get the validation to work in all browsers (main priority is the email validation)

Chrome and FF everything seems to work natively, yet surprisingly Safari validates without a proper email address. IE obviously doesn't support it either

Could anyone help with a reasonably straightforward fallback (probably via Modernizr)?

Thanks

Have you tried webshims lib ? It's build on top of jQuery and I have implemented the forms chapter of HTML5 very accurately. You can find a list of supported attributes, properties and methods on the webforms site of webhims lib .

I would like to have some feedback on this.

cheers Alex

请记住,应该在服务器端进行适当的验证,您可以轻松地插入许多jQuery验证插件中的一个

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