Forum Moderators: open
Anyone have some experience with javascript in forms sent to PayPal? Specifically, once a purchaser clicks the add to cart button, PayPal cart pops up with "Options" which include stock numbers, etc for reference. Problem is, I can't seem to figure out how to get the info from a series of check boxes (scripted so that up to a specific number can be checked at on time)into the options section. Any ideas as to what I mat be missing?
Mike
<td><div align="center"> <font size="+1" face="Courier New, Courier, mono"><strong>$1000
</strong></font>
<form name="two" form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<font face="Courier New, Courier, mono"><font face="Courier New, Courier, mono">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="ads@ddddddd.com">
<input type="hidden" name="item_name" value="Ad Space">
<input type="hidden" name="item_number" value="news2t">
<input type="hidden" name="amount" value="1,000.00">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.ddddddd.com/thankyou.html">
<input type="hidden" name="cancel_return" value="http://www.dddddddd.com/cancel.html">
<input type="hidden" name="currency_code" value="USD">
</font>
<table>
<tr>
<td width="150"><p align="left"><font face="Courier New, Courier, mono">Which
<font color="#FF0000">2 </font>Newsletters? </font></p>
<p align="left"> <font face="Courier New, Courier, mono">
<input type="checkbox" name="checkbox" value="checkbox" onClick="return KeepCount()">
a </font></p>
<p align="left"> <font face="Courier New, Courier, mono">
<input type="checkbox" name="checkbox2" onClick="return KeepCount()" value="checkbox">
b</font></p>
<p align="left"> <font face="Courier New, Courier, mono">
<input type="checkbox" name="checkbox3" onClick="return KeepCount()" value="checkbox">
c</font></p>
<p align="left"> <font face="Courier New, Courier, mono">
<input type="checkbox" name="checkbox4" onClick="return KeepCount()" value="checkbox">
d</font></p>
<p align="left"> <font face="Courier New, Courier, mono">
<input type="checkbox" name="checkbox5" onClick="return KeepCount()" value="checkbox">
e</font></p>
<p align="left"> <font face="Courier New, Courier, mono">
<input type="checkbox" name="checkbox6" onClick="return KeepCount()" value="checkbox">
f</font></p></td>
</tr>
<tr>
<td><font face="Courier New, Courier, mono">
<input type="hidden" name="on0" value="Ad Number (Begins "T" to qualify)">
Ad Number </font></td>
<td width="152"><font face="Courier New, Courier, mono">
<input type="text" name="os0" maxlength="9" value="T">
</font></td>
</tr>
<tr>
<td><font face="Courier New, Courier, mono">
<input type="hidden" name="on1" value="Placement Choice">
Placement Choice</font></td>
<td><font face="Courier New, Courier, mono">
<select name="select">
<option value="No Preference">No Preference
<option value="Beginning of Newsletter">Beginning of Newsletter
<option value="Middle of Newsletter">Middle of Newsletter
<option value="End of Newsletter">End of Newsletter
</select>
</font></td>
</tr>
</table>
<p> <font face="Courier New, Courier, mono">
<input type="image" src="https://www.paypal.com/images/x-click-but22.gif" border="0" name="submit" alt="Add to Cart">
<input type="hidden" name="add" value="1">
</font></p>
<font face="Courier New, Courier, mono">
<script>
function KeepCount() {
var NewCount = 0
if (document.two.checkbox.checked)
{NewCount = NewCount + 1}
if (document.two.checkbox2.checked)
{NewCount = NewCount + 1}
if (document.two.checkbox3.checked)
{NewCount = NewCount + 1}
if (document.two.checkbox4.checked)
{NewCount = NewCount + 1}
if (document.two.checkbox5.checked)
{NewCount = NewCount + 1}
if (document.two.checkbox6.checked)
{NewCount = NewCount + 1}
if (NewCount == 3)
{
alert('You May Only Pick Two Newsletters')
document.two; return false;
}
}
</SCRIPT>
</font>
</form>
I know that the name= has to be something specific for PayPal servers to recoginize it but after emailing them twice, I have been unable to get that info from them.
Looks to me like the values for name= should be user definable - and each one unique, as you've said.
What about the attribute value=? Seems like each one should be descriptive of the choice that people check, so that the PayPal server has a value to email back to you.
I also think that a portion of your struggle may not be about the HTML in general - instead, your questions are unique to the way PayPal set up their cart. So these parts need to be resolved through PayPal's support, FAQ etc.