如何在后台获取select控件中的所有值

来源:百度知道 编辑:UC知道 时间:2024/06/14 04:22:41
假设select中有3个值,分别为1,2,3
如何在后台获取它的值???

只有设置了 runat="server" ,在后台才可以访问。

示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<select id="mySelect" runat="server">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<div id