用以下方式,取得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>