如何使用HTML5进行多输入验证? [英] how to make multiple input validation using HTML5?

查看:120
本文介绍了如何使用HTML5进行多输入验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML5使用正则表达式提供JavaScript验证的替代方法。
但是我想在单个输入字段上添加多个验证,并根据它应该显示消息。

HTML5 provides alternate of JavaScript validation using Regular Expression. But I want to add multiple validation on single input field and according to that it should show the message.

例如。

< input type = passowrd name = passowrd />

这里的密码字段应包含以下验证和消息。

Here password field should contains following validation with message.

推荐答案

我担心单靠HTML无法做到(不,甚至不是HTML5)。

I'm afraid it cannot be done with HTML alone (no, not even HTML5).

你必须使用JavaScript完成任务。

You'll have to use JavaScript to achieve the task.

这篇关于如何使用HTML5进行多输入验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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