用一个按钮来代替onchange,增加列表项
<Script Language=VbScript>
Sub ChangeEditText(TextBox,ListBox)
Dim NewOption
Set NewOption= Document.CreateElement("option")
NewOption.Value=TextBox.Value
NewOption.Text=TextBox.Value
ListBox.Options.Add NewOption
ListBox.selectedIndex =ListBox.length -1
End Sub
</Script>
<form Id=Form method="POST" action="">
<input type="text" name="T1" size="20">
<input type="button" name="ice" value="增加" onclick="VbScript:ChangeEditText Form.All.T1,Form.All.MyList"/>
<select Id=MyList size="1" name="D1">
</select>
</form>
<Script Language=VbScript>
Sub ChangeEditText(TextBox,ListBox)
Dim NewOption
Set NewOption= Document.CreateElement("option")
NewOption.Value=TextBox.Value
NewOption.Text=TextBox.Value
ListBox.Options.Add NewOption
ListBox.selectedIndex =ListBox.length -1
End Sub
</Script>
<form Id=Form method="POST" action="">
<input type="text" name="T1" size="20">
<input type="button" name="ice" value="增加" onclick="VbScript:ChangeEditText Form.All.T1,Form.All.MyList"/>
<select Id=MyList size="1" name="D1">
</select>
</form>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货