</div>
<div>
<select name="Cid" id="Cid" style="width:120px;">
<option value="0" selected>请选择联系人</option>
<%GetlxrList Userid%>
</select>
</div>


根据onclick事件给文本框Userid赋值成功,如何把这个值参数给GetlxrList函数,谢谢!! 我要得到这个USERID对应的联系人列表
分享到: 更多

------解决办法--------------------
先用个隐藏域存起
------解决办法--------------------
GetlxrList应该是一个数据集吧  那你就可以循环ID相等你就选中

示例1:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<form name="Fname" method="get">
   <select name="Fselect">
          <option value="1" <% if request.querystring("Pvalue")=1 then %> selected <% end if %>>广东</option>
                  <option value="2" <% if request.querystring("Pvalue")=2 then %> selected <% end if %>>广西</option>
                  <option value="3" <% if request.querystring("Pvalue")=3 then %> selected <% end if %>>湖南</option>
                  <option value="4" <% if request.querystring("Pvalue")=4 then %> selected <% end if %>>湖北</option>
   </select>
   <input type="button" name="submit" value="submit" onclick="PP()">
</form>

<hr>




<form name="FFname" method="get">
   <select>
          <option <% if request.querystring("Pvalue")=1 then %> selected <% end if %> >广东</option>
                  <option <% if request.querystring("Pvalue")=2 then %> selected <% end if %>>广西</option>
                  <option <% if request.querystring("Pvalue")=3 then %> selected <% end if %>>湖南</option>
                  <option <% if request.querystring("Pvalue")=4 then %> selected <% end if %>>湖北</option>
   </select>
</form>





<script type="text/javascript">
function  PP()  {
i=Fname.Fselect.selectedIndex;
Pvalue=Fname.Fselect.options(i).value;
window.location.href="ff.asp?Pvalue="+Pvalue
}


</script>


</body>
</html>

示例2:
我这里的循环是为了下拉单一致,如果想不循环,你把选完后的下拉,变成输入框吧。像:
文件名为dd.asp
<form name="Mform" method="get" >
<%if request.QueryString("Province")="" then %>
<select onChange="PP()" name="Mselect">
<option value="广东">广东</option>
<option value="广西">广西</option>
<option value="湖南">湖南</option>
<option value="湖北">湖北</option>
</select>
<%  else  %>
<input type="text" name="P" value="<%=request.Querystring("Province")%>">
<% end if %>

<!-- select * from __ where Pid=??-->
查看全文
  相关解决方案