码迷,mamicode.com
首页 > Web开发 > 详细

js表单提交到后台对象接收

时间:2019-01-09 14:21:20      阅读:543      评论:0      收藏:0      [点我收藏+]

标签:type   gre   body   move   cuc   url   get   pre   print   

$.extend({
StandardPost:function(url,args){
var form = $("<form method=‘post‘ target=‘_blank‘></form>"),
input;
form.attr({"action":url});
$.each(args,function(key,value){
input = $("<input type=‘hidden‘>");
input.attr({"name":key});
input.val(value);
form.append(input);
});
form.appendTo(‘body‘).submit().remove();
}
});

 

下单点击按钮触发事件:
$("#btn_test").click(function () {
var data = {
maxQuotationNo:"",
maxPrice:,
salePrice:10000.00,
dealerId:,
buyerId:
};
$.StandardPost(‘http://***/***/**/toDisposePage‘, data);
});

后台取值:post 对象接收
@RequestMapping(value = "/printAgreement", method = RequestMethod.POST)
public ModelAndView printAgreement(ModelAndView modelAndView, ReceiptInstallmentVO vo ) {



js表单提交到后台对象接收

标签:type   gre   body   move   cuc   url   get   pre   print   

原文地址:https://www.cnblogs.com/beixiaoyi/p/10243905.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!