zoukankan      html  css  js  c++  java
  • 检查密码和确认密码的JavaScript

    function checkPassword()
     {
      if(document.getElementById("password").value==null||document.getElementById("password").value=="")
      {
       document.getElementById("spanPassword").innerHTML = "<font color='red'>请输入密码 *</font>";
       return false;
      }
      document.getElementById("spanPassword").innerHTML = "<font color='red'>*</font>";
     }
     
     function checkPasswordConfig()
     {
      var a=document.getElementById("password").value;
      var b=document.getElementById("passwordConfig").value;
      
      if(b==null||b=="")
      {
       document.getElementById("spanPasswordConfig").innerHTML = "<font color='red'>请您确认密码! *</font>";
       return false;
      }
      if(a!=b)
      {
       document.getElementById("spanPasswordConfig").innerHTML = "<font color='red'>您两次输入的密码不一致! *</font>";
       return false;
      }
      
      document.getElementById("spanPasswordConfig").innerHTML = "<font color='red'>*</font>";
     }

  • 相关阅读:
    PHP 单例 工厂模式 类的重载 抽象 接口
    上传文件
    ThinkPHP3.2中if标签
    JS闭包特性 运算符 DOM操作
    循环数组 连接数据库 AJAX
    ThinkPHP
    TP框架
    MVC框架
    类的自动加载,静态属性静态方法
    魔术方法__get()和set函数
  • 原文地址:https://www.cnblogs.com/xianyin05/p/3114361.html
Copyright © 2011-2022 走看看