日期:2014-05-16  浏览次数:20866 次

错误: “CheckIsNullOld”未定义
<script type="text/javascript">
  //判断浏览器,创建XMLHTTPRequest对象
  function CreateXMLHTTPRequest(){
  if(window.ActiveXObject){
  return new ActiveXObject("Microsoft.XMLHTTP");
  }else{
  return new XMLHttpRequest();
  }
  }
  //检查旧密码框文本是否为空
 function CheckIsNullOld(){
  var str=document.getElementById("ctl00_ContentPlaceHolder1_txtOldPassword").value;
  if((str+"")==null||(str+"")==""){
  document.getElementById("oldPwd").innerText="不能为空";
  return false;
  }else {
  //1.创建XMLHTTPRequest对象
  var xmlHttpRequest=new XMLHttpRequest();
  window.Function(){
  xmlHttpRequest.onreadystatechange=readyDo;
  xmlHttpRequest.open("POST","~manage/AdminModifyHandler.ashx",true);
  xmlHttpRequest.setRequestHeader("Content_Type","application/x-www-form-urlencoded");
  var data="password="+str;
  xmlHttpRequest.send(data);
   
  }
  function readyDo(){
  if(xmlHttpRequest.readyState==4&&xmlHttpRequest.status==200){
  var result=xmlHttpRequest.responseText;
  if(result=="true"){
  document.getElementById("oldPwd").innerHTML="<img alt='' src='images/duihao.jpg'/>";
  }else {
  document.getElementById("oldPwd").innerText="密码错误~";
  return false;
  }
  }
  }  
 }


上面是javascript代码


下面是html代码:
  <tr>
  <td height="30" align="right">
  旧密码:
  </td>
  <td>
  <asp:TextBox ID="txtOldPassword" MaxLength="20" onblur="CheckIsNullOld()" TextMode="Password"
  runat="server"></asp:TextBox><span id="oldPwd" class="notice">*</span>
  </td>
  </tr>
  <tr>
  <td height="30" align="right">
  新新密码:
  </td>
  <td>
  <asp:TextBox ID="txtNewPassword" MaxLength="20" TextMode="Password" onblur="CheckIsNullNew()"
  runat="server" ValidationGroup="a"></asp:TextBox><span id="newPwd" class="notice">*</span>
  </td>
  </tr>
  <tr>
  <td height="30" align="right">
  确认新密码:
  </td>
  <td>
  <asp:TextBox ID="txtReNewPassword" MaxLength="20" TextMode="Password" onblur="CheckIsNullReNew()"
  runat="server" ValidationGroup="a"></asp:TextBox><span id="ReNewPwd" class="notice">*</span>