The first form:
<form name="Sendform" method="post" action="https://aaa.bbb.com/somthing" target="_blank" accept-charset="UTF-8">
<input class="send_input" type="text" name="1" id="1" placeholder="name" />
<img src="/images/sendBTN.png" onclick="Sendform.submit();submitForm();"/>
</form>
//Sendform.submit(); <-- sending it to the action url
//submitForm(); <-- call a js function that will send another email
The second one
function submitForm()
{
var first = $("input#1.send_input").val();
var redirect = 'http://localhost:8088';
var action = 'http://localhost:8088/wp-login.php?action=register';
var method = 'post';
var params = {'first_name':first,'redirect_to':redirect};
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", action);
form.setAttribute("accept-charset","UTF-8");
form.setAttribute("name", "registerform");
form.setAttribute("id", "registerform");
for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("id", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();//<-- send the second email
}