K
kylixer
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟对HTML,JavaScript等不是很熟,实乃工作所迫做了如下试验,请问如下代码有何问题?执行时报错“‘aform.userlist.options[...].value’不是对象”!
<html>
<head>
<title>Cookie_Test_01</title>
<script language="javascript">
function pListChange(aform)
{
aform.txt.value=
aform.userlist.options[aform.userlist.SelectedIndex].value;
}
</script>
</head>
<body bgcolor="#003366" text="#FFFFFF">
<form name="frmCookie">
<select name="userlist" onchange="pListChange(document.frmCookie)">
<option value="aa">Test-01
<option value="bb">Test-02
<option value="cc">Test-03
<option value="dd">Test-04
</select>
<input type="text" name="txt">
</form>
</body>
</html>
请各位猛将兄指点迷津,谢谢!
<html>
<head>
<title>Cookie_Test_01</title>
<script language="javascript">
function pListChange(aform)
{
aform.txt.value=
aform.userlist.options[aform.userlist.SelectedIndex].value;
}
</script>
</head>
<body bgcolor="#003366" text="#FFFFFF">
<form name="frmCookie">
<select name="userlist" onchange="pListChange(document.frmCookie)">
<option value="aa">Test-01
<option value="bb">Test-02
<option value="cc">Test-03
<option value="dd">Test-04
</select>
<input type="text" name="txt">
</form>
</body>
</html>
请各位猛将兄指点迷津,谢谢!