变量值传到隐藏域问题
两个ASP网页如下======hiden.asp===========<html><head></head><body><scriptlanguage="JavaScri...
两个ASP网页如下
======hiden.asp===========
<html><head></head><body>
<script language="JavaScript" type="text/JavaScript">
var answerstring = "this is my answers!!!!!"
</script>
<form action="hidenresponse.asp" method="post">
<input name="hidentext" type="hidden" value =answerstring>
<%= request("hidentext")%>
<p><input type="submit" name="b1" value="提交"></p>
</form>
</body></html>
======hidenresponse.asp=======
<html><head></head><body>
<center><h2>
<p>你的选择字串是:<%=request("hidentext")%></p>
</body>
</html>
原意是想把变量answerstring的值传递到服务器,但最终并不是显示其
值“this is my answers!!!!!”而总是显示“answerstring”
为什么? 展开
======hiden.asp===========
<html><head></head><body>
<script language="JavaScript" type="text/JavaScript">
var answerstring = "this is my answers!!!!!"
</script>
<form action="hidenresponse.asp" method="post">
<input name="hidentext" type="hidden" value =answerstring>
<%= request("hidentext")%>
<p><input type="submit" name="b1" value="提交"></p>
</form>
</body></html>
======hidenresponse.asp=======
<html><head></head><body>
<center><h2>
<p>你的选择字串是:<%=request("hidentext")%></p>
</body>
</html>
原意是想把变量answerstring的值传递到服务器,但最终并不是显示其
值“this is my answers!!!!!”而总是显示“answerstring”
为什么? 展开
2个回答
展开全部
<html><head></head><body>
<script language="JavaScript" type="text/JavaScript">
var answerstring = "this is my answers!!!!!";
hidentext.value=answerstring;
</script>
<form action="hidenresponse.asp" method="post">
<input name="hidentext" type="hidden">
<%= request("hidentext")%>
<p><input type="submit" name="b1" value="提交"></p>
</form>
</body></html>
<script language="JavaScript" type="text/JavaScript">
var answerstring = "this is my answers!!!!!";
hidentext.value=answerstring;
</script>
<form action="hidenresponse.asp" method="post">
<input name="hidentext" type="hidden">
<%= request("hidentext")%>
<p><input type="submit" name="b1" value="提交"></p>
</form>
</body></html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询