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

JQuery 动态提交form

时间:2015-07-16 22:15:30      阅读:417      评论:0      收藏:0      [点我收藏+]

标签:jquery

    function exportExcel() {
        var merchantName = $('#merchantName').val();
        var merchantNo = $('#merchantNo').val();
        var orderNo = $('#orderNo').val();
        var phone = $('#phone').val();
        var orderStatus = $('#orderStatusCombobox').combobox('getValue');
        var paidStatus = $('#hasPaidCombobox').combobox('getValue');
        var refundStatus = $('#hasRefundCombobox').combobox('getValue');
        var firstDealStatus = $('#firstDealCombobox').datebox('getValue');
        var createDateFrom = $('#createDateFrom').datebox('getValue');
        var createDateTo = $('#createDateTo').datebox('getValue');
        var opts = $('#orderDetailGrid').datagrid('options');
        var params = {
            merchantName: merchantName,
            merchantNo: merchantNo,
            orderNo: orderNo,
            phone: phone,
            orderStatus: orderStatus,
            paidStatus: paidStatus,
            refundStatus: refundStatus,
            firstDealStatus: firstDealStatus,
            createDateFrom: createDateFrom,
            createDateTo: createDateTo,
            page: opts.pageNumber,
            rows: opts.pageSize
        };
        $("body").append("<form></form>");
        $("body").find("form").attr("action", '/yami/backend/order.exportOrderDetails.do');
        $("body").find("form").attr("method", "post");
        $("body").find("form").attr("style", "display:none");
        $.each(params, function (k, v) {
            $("body").find("form").append("<input type='text' name='" + k + "' value = '" + v + "'></input>");
        });
        $("body").find("form").submit();
    }

版权声明:本文为博主原创文章,未经博主允许不得转载。

JQuery 动态提交form

标签:jquery

原文地址:http://blog.csdn.net/hackcoder/article/details/46916923

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