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

求助,我发现不了问题。总是跑不动。
HTML code

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<link href="tecom_style.css" rel="stylesheet" type="text/css">
<title></title>
<base target="_self">
<script language="javascript">
var sys_language = '0';
</script>
<script language="javascript" src="prompt.js"></script>
<script language="javascript" src="tecomWebUtil_1.js"></script>
<script language="javascript" src="tecomWebUtil_2.js"></script>
<script language="javascript">
 var smpstartnumber =100 ;
 var smpendnumber =150 ;
function btnSave()
{
    alert("111111");
    var datacheck = true;
    if(document.UCDGroupForm.UCDGroupstartnumber.value == )
    {
        alert("The start number couldn't be NULL!");
        datacheck = false;
    }
    var start = parseInt(document.UCDGroupForm.UCDGroupstartnumber.value);
    var end = start + 500;
    alert(start);
    alert(end);
   var groupnum;
  for(var i = 0; i < 500; i++)
  {
    groupnum = eval("group" + i.toString()).value;
    if(groupnum < start || groupnum > end){
            alert("The GroupNO. is beyond the valid range!");
         datacheck = false;
    }
  }
    if(datacheck==true)
    {
      if(ValidateForm(UCDGroupForm) != true)
      return false;
      var loc = "UCDGroup.pbx?";
      UCDGroupForm.submit();
    }
}
</script>
</head>


这是JS部分

下面是那个按钮

HTML code

<input type="button" value="Save Settings" onClick="btnSave()">



如上所述,点击button无反应。
错误控制台提示btnSave is not defined.



------解决方案--------------------
点击按钮前就有错误吧?
比如,下面这行代码就有问题:
JScript code
if(document.UCDGroupForm.UCDGroupstartnumber.value == )

------解决方案--------------------
if(document.UCDGroupForm.UCDGroupstartnumber.value ==null )
------解决方案--------------------
探讨

引用:

点击按钮前就有错误吧?
比如,下面这行代码就有问题:
JScript code
if(document.UCDGroupForm.UCDGroupstartnumber.value == )

alert("111111")
都没走到、、、

------解决方案--------------------
if(document.UCDGroupForm.UCDGroupstartnumber.value ==)
这句话不完整,分析这个函数错误,你调用就会提示不存在了。