当前位置: 代码迷 >> Java Web开发 >> 高手:这样做有关问题出现在哪
  详细解决方案

高手:这样做有关问题出现在哪

热度:21   发布时间:2016-04-17 16:01:51.0
高手:这样做问题出现在哪?
<script   language= "javascript ">
function   testChangeName(formObj){
formObj.input_1.name   =   "input_0 ";
alert(formObj( "input_0 ").value);
}

</script>

<FORM   method= "get ">
<input   type= "text "   name= "input_1 ">
<input   type= "button "   value= "testChangeName "   name= "b3 "   onclick= "testChangeName(this.form); ">
</FORM>

------解决方案--------------------
<FORM method= "get " name= "form ">
------解决方案--------------------
这样就对了
------解决方案--------------------
加一个name给 <FORM method= "get ">
------解决方案--------------------
<script language= "javascript ">
function testChangeName(formObj){
formObj.input_1.name = "input_0 ";
alert(formObj.input_0.value);
}

</script>

<FORM method= "get ">
<input type= "text " name= "input_1 ">
<input type= "button " value= "testChangeName " name= "b3 " onclick= "testChangeName(this.form); ">
</FORM>

------解决方案--------------------
formObj.input_1.id = "input_0 ";
  相关解决方案