采用prototype.js +ajax做的
其部分代码:
function postdata(){
var searchForm=From.serialize('MAINFORM');
//alert(searchForm);
new Ajax.Request("${pageContext.request.contextPath}/searchData.do?method=searchData",
{method: 'get',parameters:searchForm,onComplete:function(request)
{
var divObj = document.getElementById("searchData");
divObj.style.display= "";
divObj .innerHTML= request.responseText;
}
);
}其html部分:
<form name="MAINFORM" id="MAINFORM" method="POST">
<tr>
<td width="580" height="34" bgcolor="#CCCCCC"><span
class="STYLE3">请输入搜索条件</span>: <input type="text" size="40"
height="34" style="background: #CCCCCC" id="searchValue" name="searchValue">
<input name="button" id="button" onClick="sbutton()"
type="button" class="STYLE3"
style="border: #000000; width: 50px; height: 34px" value="搜索" /></td>
</tr>
</form>我在后台用request.getParameter("searchValue");
获取到数据居然是null请问怎么搞的哦?难道写的不对吗?
其部分代码:
function postdata(){
var searchForm=From.serialize('MAINFORM');
//alert(searchForm);
new Ajax.Request("${pageContext.request.contextPath}/searchData.do?method=searchData",
{method: 'get',parameters:searchForm,onComplete:function(request)
{
var divObj = document.getElementById("searchData");
divObj.style.display= "";
divObj .innerHTML= request.responseText;
}
);
}其html部分:
<form name="MAINFORM" id="MAINFORM" method="POST">
<tr>
<td width="580" height="34" bgcolor="#CCCCCC"><span
class="STYLE3">请输入搜索条件</span>: <input type="text" size="40"
height="34" style="background: #CCCCCC" id="searchValue" name="searchValue">
<input name="button" id="button" onClick="sbutton()"
type="button" class="STYLE3"
style="border: #000000; width: 50px; height: 34px" value="搜索" /></td>
</tr>
</form>我在后台用request.getParameter("searchValue");
获取到数据居然是null请问怎么搞的哦?难道写的不对吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货