html5 form validation not working in iOS UIWebView

2019-07-26 02:50发布

问题:

i'm loading a page with HTML5 validated elements, and using methods like "required" and max-length, they work on Android WebViews but not in iOS's.

Is there a way to support that and other HTML5 functions that I use? or i always have to write my own validation methods?

回答1:

Safari does not fully support form validation: http://caniuse.com/#feat=form-validation

You can either write your own JavaScript-based validation, or use an existing polyfill.

Update: Safari 10.1 includes full interactive form validation.