日期:2014-05-18  浏览次数:20591 次

高手:这样做问题出现在哪?
<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 ";