且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery动态创建和提交表单

更新时间:2023-02-15 15:36:41

尝试首先将表单附加到body元素:

Try to append the form to the body element first:

$('<form>', {
    "id": "getInvoiceImage",
    "html": '<input type="text" id="componentInvoicId" name="componentInvoicId" value="' + componentInvoiceId + '" />',
    "action": window.siteRoot + 'ComponentInvoice/GetInvoiceImage/'
}).appendTo(document.body).submit();