HELP! JavaScipt in HTML

liunx

Guest
I'm having problems getting my online JavaScript calculator data (estentially a 1/2 shopping cart) into the PayPal shopping cart. We want the total value (not necessary to have all line items sent to cart) to be sent into the shopping cart at PayPal. I cannot seem to figure out the function needed to make it work in the name=amount value="" below, I think I can't do _JavaScript inside this HTML line so I will have to write a function that puts the value in there when the button is pushed but before it is sent. Are there any Ace's out there who know how to do this? Or is it too difficult?<br />
<br />
Here's the website address:<br />
<!-- w --><a class="postlink" href="http://www.atlantadigitalprinting.com/prod=11x17brochures-r3b-3.htm">www.atlantadigitalprinting.com/prod=11x ... -r3b-3.htm</a><!-- w --><br />
<br />
Here's the code I have so far:<br />
<form name="frmBrochures" action=https://www.paypal.com/cgi-bin/webscr method=post><br />
<input type=hidden name=cmd value=_cart><br />
<input type=hidden name=business value="[email protected]"><br />
<input type=hidden name=item_name value="Brochures"><br />
<input type=hidden name=item_number value=""><br />
<input type=hidden name=amount value=document.frmBrochures.Total.value><br />
<input type=hidden name=quantity value="1"><br />
<input type=hidden name=currency_code value="USD"><br />
<input type=hidden name=shipping value="0"><br />
<input type=hidden name=shipping2 value=""><br />
<input type=hidden name=handling value=""><br />
<input type=hidden name=handling_cart value=""><br />
<input type=hidden name=tax value=""><br />
<input type=hidden name=add value=1><br />
<input type=submit value='Add to Basket'></form><!--content-->juliec,<br />
Try to create a javascript function like below and place it inside the <HEAD> tag of your html page. <br />
<br />
<script language="JavaScript"><br />
function submitform() {<br />
document.frmBrochures.amount.value = '';<br />
document.frmBrochures.submit();<br />
}<br />
</script><br />
<br />
On your form place the onsubmit call to the function above just like this:<br />
<br />
<form name="frmBrochures" action=https://www.paypal.com/cgi-bin/webscr method=post onsubmit="submitform()"><br />
<br />
When you click on the submit button on the form, it will call then function, blank out the value, then submit the form. <br />
<br />
Good Luck!<!--content-->I don't know what you used to create that source code, but it's terrible. There is no form element called Total inside the frmBrochures form. In fact the Total form element isn't even in a form.<!--content-->
 
Back
Top