jQuery, js 验证两次输了密码的一相同
- <div class="form-group">
- <label class="col-sm-2 control-label font">新密码</label>
- <div class="col-xs-10">
- <input type="password" class="form-control bt" name="pwd" id="pwd" placeholder="请设置新密码">
- </div>
- </div><br/><br/><br/>
- <div class="form-group">
- <label class="col-sm-2 control-label font">确认新密码</label>
- <div class="col-xs-10">
- <input type="password" class="form-control bt" name="pwd" id="pwd1" placeholder="请再次填写新密码" onkeyup="validate()"><span id="tishi"></span>
- </div>
- </div><br/><br/>
- <button type="button" class="btn btn-primary btn-lg btn-block xg" id="xiugai" >修改</button>
js写法
- function validate() {
- var pwd1 = document.getElementById("pwd").value;
- var pwd2 = document.getElementById("pwd1").value;
- <!-- 对比两次输入的密码 -->
- if(pwd1 == pwd2)
- {
- document.getElementById("tishi").innerHTML="<font color='green'>两次密码相同</font>";
- document.getElementById("button").disabled = false;
- }
- else {
- document.getElementById("tishi").innerHTML="<font color='red'>两次密码不相同</font>";
- document.getElementById("button").disabled = true;
- }
- }
jQuery写法
- function validate() {
- var pwd = $("#pwd").val();
- var pwd1 = $("#pwd1").val();
- <!-- 对比两次输入的密码 -->
- if(pwd == pwd1)
- {
- $("#tishi").html("两次密码相同");
- $("#tishi").css("color","green");
- $("#xiugai").removeAttr("disabled");
- }
- else {
- $("#tishi").html("两次密码不相同");
- $("#tishi").css("color","red")
- $("button").attr("disabled","disabled");
- }
- }
jQuery, js 验证两次输了密码的一相同的更多相关文章
- js验证两次输入的密码是否一致
原文链接:http://blog.csdn.net/DDfanL/article/details/51460324
- JS验证两次输入密码是否相同
js中 <script>function check(){ with(document.all){if(input1.value!=input2.value){alert("fa ...
- js验证手机号码 ,昵称,密码
手机号 /^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/ 传真~ /^(\d{3,4}-)?\d{7,8}$/ 邮箱 ^[a-z0-9]+([._\\ ...
- [Jquery] js验证手机号
function checkIdPhone(id,idErr){ var reg0=/^(13[0-9]|15[012356789]|18[01235,idErr6789]|14[57]|17[0]) ...
- vue中将验证表单输入框的方法写在一个js文件中(表达式验证邮箱、身份证、号码、两次输入的密码是否一致)
文章目录 1.实现的效果 2.编写的js文件(这里写在了api文件下) 3.在vue页面中引入(script) 4.页面代码 1.实现的效果 20220606_154646 2.编写的js文件(这里写 ...
- 利用 jQuery 来验证密码两次输入是否相同
html <div class="row"> <div class="panel panel-info"> <div class= ...
- jQuery Validate验证框架详解(jquery.validate.min.js)
原博客 jQuery Validate验证框架详解 jQuery校验官网地址:https://jqueryvalidation.org/ 一.导入js库 <script type="t ...
- JS验证控件jQuery Validate
jQuery Validate 插件为表单提供了强大的验证功能,让客户端表单验证变得更简单,同时提供了大量的定制选项,满足应用程序各种需求.该插件捆绑了一套有用的验证方法,包括 URL 和电子邮件验证 ...
- jQuery/js 正则收集(邮件验证、)
var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; //验证邮箱的正则表达式if( ...
随机推荐
- 【leetcode】980. Unique Paths III
题目如下: On a 2-dimensional grid, there are 4 types of squares: 1 represents the starting square. Ther ...
- SCP-bzoj-1079
项目编号:bzoj-1079 项目等级:Safe 项目描述: 戳这里 特殊收容措施: DP.普通的状压状态数515,显然TLE+MLE,我们考虑把底数和幂换一换,压成155的状态数. 故状态设计为:f ...
- configure: error: libXpm.(a|so) not found
libXpm-devel明明已经安装过了,libXpm.so之类的也都存在,但是还是一直报这个问题, 百度了很长时间,终于找到了: configure一般的搜索编译路径为/usr/lib/下,因为ph ...
- 【HDOJ6581】Vacation(模拟)
题意:有标号从0到n的n+1辆车,每辆车离终点的距离为s[i],车长为l[i],速度为v[i],规定不能超车,问何时所有车都能过终点线 n<=1e5,保证 思路: #include<bit ...
- <自动化测试>之<selenium API 用法2>
不知道之前的selenium API 用法1,有没有去练习, 个人认为线性代码还是要靠敲的, 后面的模块化除了多敲还需要一定的编程思想去理解, 今天下午不是很忙就给来这儿补充点selenium api ...
- sequel 远程连接 MySQL 连接错误Can't connect to MySQL server on (61)
Mac sequel Pro链接时报错Can’t connect to MySQL server on ‘xx.xx.xx.xx’ (61). PS. win版Navicat 报错Can’t conn ...
- 修改Tomcat的server.xml之后,tomcat 部署项目报错:Removing obsolete files from server... Could not clean server of obsolete files: null java.lang.NullPointerException
介个是你在clean tomcat的时候 文件没有clean清.(临时崩溃 系统宕机或其他原因)导致自己eclipse里的service.xml 在clean时没有copy一致. 解决方案: 1找到你 ...
- HTML 文档流,设置元素浮动,导致父元素高度无法自适应的解决方法(高度欺骗)
元素浮动定义 float 属性定义元素在哪个方向浮动.以往这个属性总应用于图像,使文本围绕在图像周围,不过在 CSS 中,任何元素都可以浮动.浮动元素会生成一个块级框,而不论它本身是何种元素. 如果浮 ...
- Linux常用命令的使用方法
Linux 命令大全 Linux 命令大全 1.文件管理 cat chattr chgrp chmod chown cksum cmp diff diffstat file find git gitv ...
- python四种方法实现去除列表中的重复元素
转载:https://blog.csdn.net/together_cz/article/details/76201975 def func1(one_list): ''''' 使用集合,个人最常用 ...