html5 form validation not working in iOS UIWebView

笑着哭i 提交于 2019-12-11 05:33:30

问题


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.




回答2:


It worked for me in the WKWebView! If you using Cordova, have a look at https://github.com/apache/cordova-plugin-wkwebview-engine. It's simple to integrate.



来源:https://stackoverflow.com/questions/37323914/html5-form-validation-not-working-in-ios-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!