html5表单验证无法在iOS UIWebView中使用 [英] html5 form validation not working in iOS UIWebView

查看:145
本文介绍了html5表单验证无法在iOS UIWebView中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加载一个包含HTML5验证元素的页面,并使用required和max-length等方法,它们适用于Android WebViews但不适用于iOS版本。

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.

有没有办法支持我使用的那个和其他HTML5函数?或者我总是要写自己的验证方法?

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

推荐答案

Safari不完全支持表单验证: http://caniuse.com/#feat=form-validation

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

您可以编写自己的基于JavaScript的验证,也可以使用现有的polyfill

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

更新: Safari 10.1 包括完整的交互式表单验证。

Update: Safari 10.1 includes full interactive form validation.

这篇关于html5表单验证无法在iOS UIWebView中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆