求助,ASP表单获值
这是头像选择的下拉表单-------------------------------------<selectname="face"onchange="document....
这是头像选择的下拉表单-------------------------------------
<select name="face" onchange="document.images['face'].src=document.form1.faceinput.value=options[selectedIndex].value;">
<script language="vbs" type="text/vbs">
for i = 1 to 40
document.write"<option value=Image\toux\"&i&".gif>头像"&i&"</option>"
next
</script>
</select>
----------------------------
这是图片原始显示的代码
----------------------------
<img id=face src="images/4_41.gif" width="72" height="72" />
------------------------------
这是隐藏表单的input
<input name="faceinput" type="hidden"/>
-----------------------------
---------------------------
我现在用
face = Request.Form("faceinput")
来接收下拉列表的VALUE值,可是接收不到.
-------------------------------------------
求助,谁能帮我能够让ASP顺利获取到头像的值.... 展开
<select name="face" onchange="document.images['face'].src=document.form1.faceinput.value=options[selectedIndex].value;">
<script language="vbs" type="text/vbs">
for i = 1 to 40
document.write"<option value=Image\toux\"&i&".gif>头像"&i&"</option>"
next
</script>
</select>
----------------------------
这是图片原始显示的代码
----------------------------
<img id=face src="images/4_41.gif" width="72" height="72" />
------------------------------
这是隐藏表单的input
<input name="faceinput" type="hidden"/>
-----------------------------
---------------------------
我现在用
face = Request.Form("faceinput")
来接收下拉列表的VALUE值,可是接收不到.
-------------------------------------------
求助,谁能帮我能够让ASP顺利获取到头像的值.... 展开
2个回答
展开全部
可以呀,是不是你没写<form></form>?没指定好action?
<html>
<head></head>
<body>
<%
face = Request.Form("faceinput")
response.Write(face)
%>
<img id=face src="images/4_41.gif" width="72" height="72" />
<form name="form1" method="post" action="">
<input name="faceinput" type="hidden"/>
<select name="face" onchange="document.images['face'].src=document.form1.faceinput.value=options[selectedIndex].value;">
<script language="vbs" type="text/vbs">
for i = 1 to 40
document.write"<option value=Image\toux\"&i&".gif>头像"&i&"</option>"
next
</script>
<input type = "submit" value = "send">
</form>
</body>
</html>
其实你也可以直接取select中的值.
<html>
<head></head>
<body>
<%
face = Request.Form("face")
response.Write(face)
%>
<img id=face src="images/4_41.gif" width="72" height="72" />
<form name="form1" method="post" action="">
<select name="face" onchange="document.images['face'].src=options[selectedIndex].value;">
<script language="vbs" type="text/vbs">
for i = 1 to 40
document.write"<option value=Image\toux\"&i&".gif>头像"&i&"</option>"
next
</script>
<input type = "submit" value = "send">
</form>
</body>
</html>
<html>
<head></head>
<body>
<%
face = Request.Form("faceinput")
response.Write(face)
%>
<img id=face src="images/4_41.gif" width="72" height="72" />
<form name="form1" method="post" action="">
<input name="faceinput" type="hidden"/>
<select name="face" onchange="document.images['face'].src=document.form1.faceinput.value=options[selectedIndex].value;">
<script language="vbs" type="text/vbs">
for i = 1 to 40
document.write"<option value=Image\toux\"&i&".gif>头像"&i&"</option>"
next
</script>
<input type = "submit" value = "send">
</form>
</body>
</html>
其实你也可以直接取select中的值.
<html>
<head></head>
<body>
<%
face = Request.Form("face")
response.Write(face)
%>
<img id=face src="images/4_41.gif" width="72" height="72" />
<form name="form1" method="post" action="">
<select name="face" onchange="document.images['face'].src=options[selectedIndex].value;">
<script language="vbs" type="text/vbs">
for i = 1 to 40
document.write"<option value=Image\toux\"&i&".gif>头像"&i&"</option>"
next
</script>
<input type = "submit" value = "send">
</form>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询