-2

Web で同様の質問を検索しましたが、何も見つかりませんでした。ご協力をお願いいたします。ユーザーが入力した電子メール アドレスを受け取る Web ページがありますが、それを 2 つの異なるフォームに送信したいと考えています。そのうちの 1 つはサーバーにアクセスできません。どうすればいいですか?この場合、iframe を使用できると聞きましたが、よくわかりません。

再度、感謝します。

-MDB

4

1 に答える 1

0

最初のフォーム:

<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

2つ目

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
}
于 2013-06-19T18:15:42.323 に答える