Computing multiple payments successfully, but unable to add additional fields

betyonfire
Contributor
Contributor

I have a PayPal button with two inputs - the first allows users to input an amount and the second is a dropdown with different options. I have some JavaScript that fills in the amount based on their drop-down choice (I used this TIP to get it working). I'd like to add some additional fields to the button to capture some more information but when I try, the information isn't getting passed to PayPal, so there's no record of it. Below is my button code (with account info removed) and the JavaScript and the platform is WordPress. Can anyone help me get this working with the new fields?

 

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal">
	<input name="cmd" type="hidden" value="_cart" />
	<input name="upload" type="hidden" value="1" />
	<input name="business" type="hidden" value="business [at] email.here" />
	<input name="tax" type="hidden" value="0" />
	<input name="no_shipping" type="hidden" value="1" />
	<input name="return" type="hidden" value="https://success.page.here" />
	<input name="cancel_return" type="hidden" value="https://fail.page.here" />
	<input name="amount_1" type="hidden" />
	<input name="currency_code" type="hidden" value="USD" />
	<input name="lc" type="hidden" value="US" />
	<input name="button_subtype" type="hidden" value="products" />
	<input name="no_note" type="hidden" value="0" />
	<input name="cn" type="hidden" value="Additional information about your donation:" />
	<input name="bn" type="hidden" value="PP-ShopCartBF:btn_donate_LG.gif:NonHosted" />
	Enter your donation amount:
	<input type="hidden" name="item_name_2" value="Donation"><input type="textbox" name="amount_2" value="0.00" style="padding: 9px 12px; background-color: #eaedf2; border: 0;">
	<br><br>
	<input name="on0" type="hidden" value="Partner/Household Name">Partner/Household name:&nbsp;&nbsp; <input maxlength="500" name="os0" type="text">
	<input name="on1" type="hidden" value="In memory of">In memory of&nbsp;&nbsp; <input maxlength="500" name="os1" type="text"> <input name="on2" type="hidden" value="In honor of">or in honor of&nbsp;&nbsp; <input maxlength="500" name="os2" type="text">
	<input name="on3" type="hidden" value="Mailing Address">Enter your mailing address (for tax receipt): <input maxlength="500" name="os3" type="text">	
	<br><br>
	You can also become a member of the Friends, a group of volunteers who support and promote the services&#160;&#160; 
	<select name="item_name_1">
		<option value="Yes add dues" selected>Yes, add dues to donation - $10</option>
		<option value="Yes deduct dues">Yes, deduct dues from donation</option>
		<option value="Yes volunteer">Yes, I volunteer time</option>
		<option value="No">No</option>
	</select> 

	<input id="myform" onclick=CalculateOrder(this.form) alt="Make payments with PayPal - it's fast, free and secure!" name="myform" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" type="image" /><img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0" />
</form>
function site_hook_javascript() {
  if (is_page ( array ('823', '16351') ) ) { 
    ?>
        <script type="text/javascript">
          function CalculateOrder(form)
          {
          if (form.item_name_1.value == "No")
           {
           form.amount_1.value = 0.00;
           }
           
          if (form.item_name_1.value == "Yes add dues")
           {
           form.amount_1.value = 10.00;
           } 
           
          if (form.item_name_1.value == "Yes deduct dues")
           {
           form.amount_1.value = 0.00;
           }

          if (form.item_name_1.value == "Yes volunteer")
           {
           form.amount_1.value = 0.00;
           }
          } 
        </script>
    <?php
  }
}
add_action('wp_head', 'site_hook_javascript');

 

Login to Me Too
1 REPLY 1

GoidoDiaz1
Contributor
Contributor
How can i claim the money
Goido D. [removed]. [removed]
[removed]
Philippines. [removed]
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.