orders 表单中搜索的操作
js中的代码
function searcher() {
alert($("#sendaddress").val());
$.post("../../csdn/searchOrders.action", {
'orders.customers.id' : $("#custome").val(),
'orders.sendAddress.id' : $("#sendaddress").val(),
'orders.time' : $("#stime").datebox("getValue")
}, function(data) {
if (data != null && data != "") {
var str = data.replace(/\"/g, "");
$("#ordersList").datagrid("load", {
whereSql : str
});
}
});
}
jsp中的代码
<div region="north" title="搜索用户"
style="height: 60px; background: #B3DFDA;">
客户:<input type="text" name="customers" id="custome"/>
送货地址:<input type="text" name="sendaddress" id="sendaddress"/>
订单的时间:<input type="text" name="time" id="stime"/>
<a href="javascript:void(0)" id="search" iconCls="icon-search" onclick="searcher()">查询</a>
</div>
js中的代码
function searcher() {
alert($("#sendaddress").val());
$.post("../../csdn/searchOrders.action", {
'orders.customers.id' : $("#custome").val(),
'orders.sendAddress.id' : $("#sendaddress").val(),
'orders.time' : $("#stime").datebox("getValue")
}, function(data) {
if (data != null && data != "") {
var str = data.replace(/\"/g, "");
$("#ordersList").datagrid("load", {
whereSql : str
});
}
});
}
jsp中的代码
<div region="north" title="搜索用户"
style="height: 60px; background: #B3DFDA;">
客户:<input type="text" name="customers" id="custome"/>
送货地址:<input type="text" name="sendaddress" id="sendaddress"/>
订单的时间:<input type="text" name="time" id="stime"/>
<a href="javascript:void(0)" id="search" iconCls="icon-search" onclick="searcher()">查询</a>
</div>
本文介绍如何在JavaScript中实现基于输入参数的HTTP POST请求,并使用AJAX处理响应数据,以动态更新表格内容。具体展示了通过前端表单输入客户ID、送货地址和时间来查询并显示订单列表的过程。

436

被折叠的 条评论
为什么被折叠?



