How to submit form with "target" attribute


Form with “target” attrubute not post any data.

After submitting form with target=’_blank’ (or target=‘windowname’) Electron open new window, load page from “action” attribute, but POST data is empty. It is a bug?!

For example, in main.js:


<form method='post' id='form1' name='form1' target='_blank' action='electron-submit.php'>
<textarea id='data1' name='data1'>Some text</textarea><br>
<input type='submit' value='Submit'/>
<?php print_r($_POST); ?>

With “target” attribute will display Array ()
Without “target” attribute will display Array ([data1] => Some text)

How to submit form with “target” ?

[Bug] Post form with "target" attribute sending GET request instead of POST
[Bug] Post form with "target" attribute sending GET request instead of POST

The problem is more serious.
With the attribute “target” Electron used the wrong method GET request instead of POST.


The issue is that you’re trying to use PHP with Electron. It does not support PHP.


You do not understand the problem. Electron incorrectly sends HTTP request to the server. The request must be POST method, but Electron sends GET. The server and programming language on the server side can be any. Electron should not be support PHP.