【发布时间】:2014-03-10 17:48:45
【问题描述】:
我有一个项目,我必须在其中添加一个注册表单,并且我想验证密码和确认字段是否相等,而无需单击注册按钮。
如果密码和确认密码字段不匹配,那么我还想在确认密码字段旁边放一条错误消息并禁用注册按钮。
以下是我的html代码..
<form id="form" name="form" method="post" action="registration.php">
<label >username :
<input name="username" id="username" type="text" /></label> <br>
<label >password :
<input name="password" id="password" type="password" /></label>
<label>confirm password:
<input type="password" name="confirm_password" id="confirm_password" />
</label>
<label>
<input type="submit" name="submit" value="registration" />
</label>
有没有办法做到这一点?提前感谢您的帮助。
【问题讨论】:
-
方法有很多,你的尝试在哪里?
标签: javascript jquery ajax