怎么在服务器端把<select>的值取出来
比如下面的一段示例代码:<formname=form1><selectname="select1"OnChange="showList();"><optionvalue=...
比如下面的一段示例代码:
<form name=form1>
<select name="select1" OnChange="showList();">
<option value=""> </option>
<option value="0">1111</option>
<option value="1">2222</option>
</select>
<DIV ID=iHTML></DIV>
</form>
<script>
var data1 = [[1,2,3],[4,5,6,7]];
var data2 = [["1111-1","1111-2","1111-3"],["2222-1","2222-2","2222-3","2222-4"]];
function getList(iValue){
if(!form1.select1.options[form1.select1.selectedIndex].value)
return "";
var iStr = "";
for(var i=0;i<data1[iValue].length;i++)
iStr += "<option value=" + data1[iValue][i] + ">" + data2[iValue][i] + "</option>";
return "<select name=select2>" + iStr + "</select>";
}
function showList(){
iHTML.innerHTML = getList(form1.select1.options[form1.select1.selectedIndex].value);
}
</script>
现在的问题是我怎么在服务器端把select1,seclect2的值取出来?
比如客户端select1选择了1111,select2选择了了1111-2,服务器端怎么获取1111和1111-2呢?
用c#实现更佳?望高手帮帮忙,谢谢! 展开
<form name=form1>
<select name="select1" OnChange="showList();">
<option value=""> </option>
<option value="0">1111</option>
<option value="1">2222</option>
</select>
<DIV ID=iHTML></DIV>
</form>
<script>
var data1 = [[1,2,3],[4,5,6,7]];
var data2 = [["1111-1","1111-2","1111-3"],["2222-1","2222-2","2222-3","2222-4"]];
function getList(iValue){
if(!form1.select1.options[form1.select1.selectedIndex].value)
return "";
var iStr = "";
for(var i=0;i<data1[iValue].length;i++)
iStr += "<option value=" + data1[iValue][i] + ">" + data2[iValue][i] + "</option>";
return "<select name=select2>" + iStr + "</select>";
}
function showList(){
iHTML.innerHTML = getList(form1.select1.options[form1.select1.selectedIndex].value);
}
</script>
现在的问题是我怎么在服务器端把select1,seclect2的值取出来?
比如客户端select1选择了1111,select2选择了了1111-2,服务器端怎么获取1111和1111-2呢?
用c#实现更佳?望高手帮帮忙,谢谢! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询