homepage Welcome to WebmasterWorld Guest from 54.198.25.229
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Getting options from PayPal Cart into the form
A Javascript / CGI nightmare
Main_Mike

10+ Year Member



 
Msg#: 237 posted 4:31 am on Dec 8, 2002 (gmt 0)

Ok. After hours of not being able to fix a form to give me the info I want through PayPal purchases, I am venting my frustrations before I turn into a story for the Professional Funnies IT newsletter.

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

 

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 237 posted 5:56 am on Dec 8, 2002 (gmt 0)

Are you trying to get the cart to SHOW the options you want it to for an item? ... or trouble getting the cart to email you with the choice that a customer makes?

Main_Mike

10+ Year Member



 
Msg#: 237 posted 10:11 pm on Dec 10, 2002 (gmt 0)

Both. Below is the script for one of ten items, all the same except price. 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. Anyway, If the name= has to be the same thing for each checkbox, then will I no longer be able to use the scrpit that limits the checkboxes that can be checked? Any insight is helpful.

<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>

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 237 posted 11:15 pm on Dec 10, 2002 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved