请问ASP语言中request.form如何获取option的文本呢

来源:百度知道 编辑:UC知道 时间:2024/05/25 16:26:46
我知道如果写成:
<select id="test"><option>A</option></select>
则request.from("test")获取的是A
如果写成:
<select id="test"><option value="1">A</option></select>
则request.form("test")获取的是1

我的问题是:第2种写法如何用request.form获取open的文本A呢?或者用别的办法获取也可以。先谢谢了!
我要哭了,不要告诉我写成<option value="A">A</option></select>好不好。
我要的是<option value="1">A</option></select>时怎样获得文本的值。

用innerText啦:
<select id="test" onfocus="alert(document.getElementById('test').innerText)">
<option value="1">a</option>
</select>

<select id="test"><option value="A">A</option></select>

应该写成
<select id="test" name="test"><option value="A">A</option></select>
一般来说id是给js或css用的
name才是提交到服务器上去给ASP处理用的

<select name="test" onChange="alert(this.options[this.selectedIndex].text)">
<option value="1">a</option>
<option value="2">b</option>
</select>