读书人

vbscript客户端取SELECT控件的值解决办

发布时间: 2012-02-29 16:44:10 作者: rapoo

vbscript客户端取SELECT控件的值


用以下方式,取得size = 8 的select控件的值出错,但是我看不出错在了那里
selCounterID为select控件的名称

intIndex = -2
intIndex=document.form1.selCounterID.selectedIndex
strCounterID = document.form1.selCounterID.options(intIndex).value
strCheck = strCheck & strCounterID

[解决办法]
应该是可以的。换个变量名看看strCounterID1 =

HTML code
<form name="form1"><select name="selCounterID">    <option value="1">1</option>    <option value="2" selected>2</option>    <option value="3">3</option></select></form><script language="VBScript">intIndex=document.form1.selCounterID.selectedIndex strCounterID1 = document.form1.selCounterID.options(intIndex).value strCheck = strCheck & strCounterID1msgbox strCheck</script> 

读书人网 >vbScript

热点推荐