jQuery Mobile中的HTML5表单验证 [英] HTML5 form validation in jQuery Mobile

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

问题描述

你好朋友,

我有搜索页面有8个文本框。



我使用了HTML5属性,如必需,模式来验证页面中的每个文本框。



由于此HTML5表单验证仅在表单触发提交时才会发生。



当我使用jQuery mobile时,每次调用都是使用jQuery AJAX进行的。



验证:

 1。至少一个文本框非空。 
2.如果多个文本框非空,则检查其中是否包含最少3个字符。





任何想法如何我可以验证这些字段吗?



提前谢谢

解决方案

使用这个jQuery插件 - http://jqueryvalidation.org/ [ ^ ]

Hello friends,
I have search page which has 8 textbox.

I have made used of HTML5 attributes like Required, Pattern to validate every textbox in page.

Since this HTML5 form validation happens only when submit is triggred for the form.

As I'm using jQuery mobile every call is made using jQuery AJAX.

Validation:

1. Atleast one textbox is non empty.
2. If multiple textbox is non empty, then check if it has min 3 characters in it.



Any idea how I can validate those fields?

Thanks in advance

解决方案

Use this plugin of jQuery - http://jqueryvalidation.org/[^]


这篇关于jQuery Mobile中的HTML5表单验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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