Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 22nd, 2013  |  syntax: None  |  size: 1.89 KB  |  views: 35  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="payPalForm" onsubmit="if (verify()) { get_items(); return true; } else return false;">
  2. <input type="hidden" name="cmd" value="_cart" />
  3. <input type="hidden" name="upload" value="1">
  4. <input type="hidden" name="business" value="[PAYPAL EMAIL HERE]" />
  5. <input type="hidden" name="currency_code" id="currency_code" value="USD" />
  6. <input type="hidden" name="return" value="http://www.mysite.org/thank_you_kindly.html" />
  7. <p style="text-align: center"><input type="submit" name="Submit" value="Join (via PayPal)" id="register_button" /></p>
  8. </form>
  9.        
  10. function add_item(item_number, item_name, amount, qty) {
  11.     // item number
  12.     var inp1 = document.createElement("input");
  13.     inp1.setAttribute("type", "hidden");
  14.     inp1.setAttribute("id", "item_number_"+curitem);
  15.     inp1.setAttribute("name", "item_number_"+curitem);
  16.     inp1.setAttribute("value", item_number);
  17.  
  18.     // item name
  19.     var inp2 = document.createElement("input");
  20.     inp2.setAttribute("type", "hidden");
  21.     inp2.setAttribute("id", "item_name_"+curitem);
  22.     inp2.setAttribute("name", "item_name_"+curitem);
  23.     inp2.setAttribute("value", item_name);
  24.  
  25.     // amount
  26.     var inp3 = document.createElement("input");
  27.     inp3.setAttribute("type", "hidden");
  28.     inp3.setAttribute("id", "amount_"+curitem);
  29.     inp3.setAttribute("name", "amount_"+curitem);
  30.     inp3.setAttribute("value", amount);
  31.  
  32.     // qty
  33.     var inp4 = document.createElement("input");
  34.     inp4.setAttribute("type", "hidden");
  35.     inp4.setAttribute("id", "quantity_"+curitem);
  36.     inp4.setAttribute("name", "quantity_"+curitem);
  37.     inp4.setAttribute("value", qty);
  38.  
  39.     document.getElementById('payPalForm').appendChild(inp1);
  40.     document.getElementById('payPalForm').appendChild(inp2);
  41.     document.getElementById('payPalForm').appendChild(inp3);
  42.     document.getElementById('payPalForm').appendChild(inp4);
  43.     curitem++;
  44. }
clone this paste RAW Paste Data