在點擊submit
獲取值我調用這個函數:不使用的request.getParameter
function submitFunction()
{
document.forms[0].action = "Result.jsp";
document.forms[0].method = 'GET';
document.forms[0].submit();
}
的數據Result.jsp
是:
<%
out.println(request.getparameter("demo1")+"<BR>");
out.println(request.getparameter("demo2")+"<BR>");
out.println(request.getparameter("demo3")+"<BR>");
out.println(request.getParameter("demo4")+"<BR>");
out.println(request.getParameter("demo5")+"<BR>");
out.println(request.getParameter("demo6")+"<BR>");
%>
我的表格:
<form method="post" action="Result.jsp" >
<h1>Student Info</h1>
<hr>
<pre>
<b>Name</b> :<input id="demo1" type="text" value=" "/>
</pre>
<pre>
<b>Age </b> :<input id="demo2" type="text" value=" "/>
</pre>
<pre>
<b>Qualification</b> :<input id="demo3" type=isNaN value=" "/>
</pre>
<pre>
<b>Address</b> :<input id="demo4" type="text" value=" "/>
</pre>
<pre>
<b>Company Name</b> :<input id="demo5" type="text" value=" "/>
</pre>
<pre>
<b>Height</b> :<input id="demo6" type="numeric" value=" " />
</pre>
</form>
請爲此建議解決方案
相反的:
getParameter()函數中的「p」應該是大寫。 – 2013-03-07 07:21:16
thanx for ur response,但我仍然得到空值 – sravan 2013-03-07 07:25:44
你的表單在哪裏? – 2013-03-07 07:26:23