简体   繁体   中英

submit a html form in a popup window

I have a html form with this submit button:

<input type="submit" name="upload_invoice" value="Upload Invoice" onclick="window.open('upload_customer_invoice.php','','height=400,width=400'); return false;">

i want the form to submit as normal but in a popup window.

this works okay, but its not posting any data

my form tag looks like:

<form method="post" enctype="multipart/form-data">

how can i make the form submit as well as open in a popup window

You can specify the 'target' for a form. Below is a sample Java Script solution, it can be done different ways.

document.forms['yourForm'].setAttribute("target", "yourPopUp");
window.open('url', 'yourPopUp', 'height=400,width=400');
document.forms['yourForm'].submit();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM