2012-04-05 12 views
0

私のウェブサイトには全く問題がありません。 1. 1ページに2つの支払い処理フォームがあります。 2.各フォームには個別の送信ボタンがあります。同じページの1つのフォームから別のフォームにユーザー入力を渡す必要があります

問題です。 フォーム1からのユーザー入力の一部をフォーム2に渡す必要があります。 注。これは同じページにあります。

形態1

<input type="hidden" name="payfast_url" id="payfast_url" value="https://www."/> 
    <input type="hidden" name="merchant_id" id="merchant_id" value="xxxxx"/> 
    <input type="hidden" name="merchant_key" id="merchant_key" value="xxxxx"/> 
    <input type="hidden" name="return_url" id="return_url" value="payment_finished.html"/> 
    <input type="hidden" name="cancel_url" id="cancel_url" value="payment_cancelled.html"/> 
    <input type="hidden" name="notify_url" id="notify_url" value="/payment_notify.html"/> 
    <input type="hidden" name="item_name" id="item_name" value="Product name"/> 
    <input type="hidden" name="item_description" id="item_description"value="description"/> 
    <input type="hidden" name="email_confirmation" id="email_confirmation" value="1"/> 
    <input type="hidden" name="confirmation_address" id="confirmation_address" value=""/> 
    <input type="hidden" name="amount" id="amount" value="price" /> 
    <input type="hidden" name="payment_id" id="payment_id" value="website_sales" /> 
    <span class="formlable">Name</span><input name="name_first" id="name_first"type="text" value="" class="forminput"/> 
    <span class="formlable">Surname</span> <input name="name_last" id="name_last" type="text" value="" class="forminput"/> 
    <span class="formlable">E-Mail</span> <input type="text" name="email_address" id="email_address" value="" class="forminput"/> 
    <span class="formlable">Post Address</span> <input name="custom_str1" id="custom_str1" type="text" value="" class="forminput"/> 
    <span class="formlable">City</span><input name="custom_str2" id="custom_str2" type="text" value="" class="forminput"/> 
    <span class="formlable">Postal Code</span><input name="custom_str3" id="custom_str3" type="text" value="" class="forminput"/> 
<input type="button" value="EFT Payment" onclick="quickPostPaymentToPayFast(document.getElementById('payfast_url').value);" id="button" method="post"/> 

形態2

<form name="CreditCards" action="https://www.mygate.co.za/.cfm" method="post"/> 
<input type="hidden" name="Mode" id="Mode" value="0"/> 
<input type="hidden" name="txtMerchantID" id="txtMerchant" value="xxxxxxx"/> 
<input type="hidden" name="txtApplicationID" id="txtApplicationID" value="xxxxxxxx"/> 
<input type="hidden" name="txtMerchantReference" id="txtMerchantReference" value="1234"/> 
<input type="hidden" name="txtPrice" id="txtPrice" value="1234"/> 
<input type="hidden" name="txtCurrencyCode" id="txtCurrencyCode" value="ZAR"/> 
<input name="txtRedirectSuccessfulURL" value="success_failure.php" readonly="true" type="hidden"/> 
<input name="txtRedirectFailedURL" value="success_failure.php" readonly="true" type="hidden"/ >   
<input type="hidden" name="txtQty" id="txtQty" value="1"/> 
<input type="hidden" name="txtItemDescr" id="txtItemDescr" value="descr"/> 
<input type="hidden" name="txtItemAmount" id="txtItemAmount" value="449.00"/> 
<input type="hidden" name="txtRecipient"   value="<?php $_POST["name_first"]; ?>"/> 
<input type="hidden" name="txtShippingAddress1" value="<?php $_POST["name_last"]; ?>"/> 
<input type="hidden" name="txtShippingAddress2" value="<?php $_POST["email_address"]; ?>"/> 
<input type="hidden" name="txtShippingAddress3" value="<?php $_POST["custom_str1"]; ?>"/> 
<input type="hidden" name="txtShippingAddress4" value="<?php $_POST["custom_str2"]; ?>"/> 
<input type="hidden" name="txtShippingAddress5" value="<?php $_POST["custom_str3"] ?>"/> 
<input type="submit" id="button4" value="Credit card" /> 
</form> 

name_first name_last EMAIL_ADDRESS custom_str1 custom_str2カスタムSTR3 最初の形態からは、SECに転送されなければなりませんオンデマンドフォーム

ありがとう

答えて

0

クライアント側のJavaScriptを使用すると思います。 jQueryの使用をお勧めします。

JSでの経験があるかどうかはわかりませんが、それほど複雑ではありません。

基本的に、あなたがしなければならないすべては、次のとおりです。

1))が第一の入力

email = $('#email_address').val()

2の値を読む(他のフィールドに割り当てたいものをフィールドわからない、それを割り当て)

次に、このコードを送信ボタンまたは必要な場所にバインドします。

jQueryの詳細については、http://jquery.com/

関連する問題