jsp文件中JAVA和javascrip间的值传递问题,急!!! 就是将页面提交form1.submit();然后通过request.getParameter()获取提交的内容 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我給你一種思路:可以先定義 一個form<form name=form1><input type=text name=t1><input type=text name=t2></form>再用javascript 去訪問form中的元素function aaa(){ document.form1.t1.value='你要傳遞的變量'; //或者 document.forms[0].elements[0].value='你要傳遞的變量'; document.form1.t2.value='你要傳遞的變量2';////或者 document.forms[0].elements[1].value='你要傳遞的變量2';}再用javascript 實現提交function subm(){document.form1.action='提交到處理的網頁';document.form1.submit();}實現調用<input type=button onclick="aaa();"><input type=button onclick="subm();"> 你建立个隐藏域,JAVASCRIPT传值进去。当刷新时取值 JAVASCRIPTdocument.location="a.jsp?sqlVal="+aval;JSP中:request.getParameter(sqlVal)方法不止以上几种,N种呀。 log4j.properties不输出sql句 请教一个页面跳转的问题! 大家帮忙看看是什么错误 关于java里webService 兄弟。帮我 jsp结果集分列显示问题 服务器 文件同步 怎么计算距离当前时间多少秒,多少天,如SNS动态。 请教一个jdbc连ORACLE9i的问题,已经卡在这儿好几天了。 jsp_struts问题! 文件上载问题----在线等!!!!!!! Calendar 的add(field,int) 问题
可以先定義 一個form<form name=form1>
<input type=text name=t1>
<input type=text name=t2>
</form>再用javascript 去訪問form中的元素
function aaa()
{ document.form1.t1.value='你要傳遞的變量'; //或者 document.forms[0].elements[0].value='你要傳遞的變量'; document.form1.t2.value='你要傳遞的變量2';////或者 document.forms[0].elements[1].value='你要傳遞的變量2';
}再用javascript 實現提交
function subm()
{
document.form1.action='提交到處理的網頁';
document.form1.submit();
}實現調用
<input type=button onclick="aaa();">
<input type=button onclick="subm();">
document.location="a.jsp?sqlVal="+aval;
JSP中:
request.getParameter(sqlVal)
方法不止以上几种,N种呀。