Jump to content


Photo

select an amount or enter one -- giving options


  • This topic is locked This topic is locked
15 replies to this topic

#1 rache23

rache23

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 05 March 2004 - 07:05 PM

I would like to know how to combine 2 options for donation onto one form. The customer is asked to choose one method or the other -- either check a box next to an amount to donate, or enter an amount in a text field.

---Option 1---
Check a box next to the amount you wish to donate.
i.e. <input type="checkbox" name="amount" value="20.00" /> 1¢ per mile ($20.00)

---Option 2---
Enter an amount to donate in a text field.
i.e. <input type="text" name="amount" size="6" />

When I add the text field to my form (Buy It Now type form), the checkboxes do not work. When I remove the text field, the boxes work. The text field, when in place, works fine, successfully passing the amount to PayPal.

What is the best way to give customers the options to select an amount to donate or enter an arbitrary amount? Thank you in advance for any help.

#2 PayPal_Paulam

PayPal_Paulam

    Average Member

  • Members
  • 511 posts

Posted 08 March 2004 - 05:59 PM

Hi rache23,

You will need to use some scripting help,such as JaVa Script or VB Script that capture what the customer selected and override the amount variable before you submit the form.


Paulam
PayPal Tech Support Agent
PayPal an eBay company

#3 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 02 March 2005 - 10:27 AM

i am having the same issue and i was wondering if you were able to use java/vbscript to resolve it.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by rache23
[br]I would like to know how to combine 2 options for donation onto one form. The customer is asked to choose one method or the other -- either check a box next to an amount to donate, or enter an amount in a text field.

---Option 1---
Check a box next to the amount you wish to donate.
i.e. <input type="checkbox" name="amount" value="20.00" /> 1ยข per mile ($20.00)

---Option 2---
Enter an amount to donate in a text field.
i.e. <input type="text" name="amount" size="6" />

When I add the text field to my form (Buy It Now type form), the checkboxes do not work. When I remove the text field, the boxes work. The text field, when in place, works fine, successfully passing the amount to PayPal.

What is the best way to give customers the options to select an amount to donate or enter an arbitrary amount? Thank you in advance for any help.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#4 Andrew Chang

Andrew Chang

    Average Member

  • Members
  • 738 posts

Posted 02 March 2005 - 10:43 AM

view this http://paypaldev.org...p?TOPIC_ID=8146

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems

#5 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 March 2005 - 10:47 AM

I am getting an 500 Internal Error when I try to run this script.

http://www.partners-...n/paypalscr.cgi

This site is running on a Linux server. Does this make a difference?

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Andrew Chang
[br]view this http://paypaldev.org...p?TOPIC_ID=8146

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#6 Andrew Chang

Andrew Chang

    Average Member

  • Members
  • 738 posts

Posted 04 March 2005 - 10:51 AM

for the script you will need to

1 edit the #! usr/bin/perl line to the correct path to perl
2 make sure you use a editor such as notepad to edit the script
3 make sure you upload in ascii format
4 make sure permissions are set to 755

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems

#7 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 March 2005 - 12:46 PM

i did these things and i still can't get it to work... help!

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Andrew Chang
[br]for the script you will need to

1 edit the #! usr/bin/perl line to the correct path to perl
2 make sure you use a editor such as notepad to edit the script
3 make sure you upload in ascii format
4 make sure permissions are set to 755

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#8 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 March 2005 - 01:08 PM

ok, i can get it to work if i use:

$browser = "https://www.paypal.com/xclick/business=Payment%40scorpionsystems.net&item_name=Test+2+Item&item_number=store+id+%23&amount=$in{'amount'}&no_shipping=0&no_note=1¤cy_code=USD";
print "Location: $browser\n\n";

but i can't get it to work if i edit this code. what info is editable and can i add a field (i.e. on0=)

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Andrew Chang
[br]for the script you will need to

1 edit the #! usr/bin/perl line to the correct path to perl
2 make sure you use a editor such as notepad to edit the script
3 make sure you upload in ascii format
4 make sure permissions are set to 755

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#9 Andrew Chang

Andrew Chang

    Average Member

  • Members
  • 738 posts

Posted 04 March 2005 - 01:12 PM

The whole line is editable

to add on0 os0 add this to the line &on0=$in{'on0'}&os0=$in{'os0'}

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems

#10 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 March 2005 - 01:28 PM

the code is:

$browser = "https://www.paypal.com/xclick/business=mgrimes@worcesterdiocese.org&item_name=Annual+Partners+In+Charity&item_number=store+id+&amount=&on0=City+Parish&os0=City+Parish&no_shipping=0&no_note=1¤cy_code=USD";
print "Location: $browser\n\n";

when i enter the url from this code in the address bar, it goes to the proper paypal page. but this code does not want to work in the cgi script itself. why would yours work, but not mine?

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Andrew Chang
[br]The whole line is editable

to add on0 os0 add this to the line &on0=$in{'on0'}&os0=$in{'os0'}

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#11 Andrew Chang

Andrew Chang

    Average Member

  • Members
  • 738 posts

Posted 04 March 2005 - 02:12 PM

It has to do with what you are using there are a few problems

1 you are using a hyperlink this is not what you need to use you only need to enter the web address

2 the @ symbol will not work in a cgi script because it will look for the @worcesterdiocese.org array which will be empty therefore sending only mgrimes use %40 or \@
I have posted the proper code below

3. If you plan on passing difrent values in the item_name,item_number, amount, on0 and os0 you can not hard coded values

set them to $in{'fieldname'} fieldname would = the actual field name example. item_name=$in{'item_name'} this will alow the field to be filled in from the form information

$browser = "https://www.paypal.com/xclick/business=mgrimes%40worcesterdiocese.org&item_name=Annual+Partners+In+Charity&item_number=store+id+&amount=&on0=City+Parish&os0=City+Parish&no_shipping=0&no_note=1¤cy_code=USD";
print "Location: $browser\n\n";

Do you see how the code works?

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems

#12 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 07 March 2005 - 10:52 AM

ok, i finally got this to work - now the problem is that it only seems to work when i use safari as my browser. i hav tried it in explorer and firefox and i get an error from paypal saying:

The link you have used to enter the PayPal system contains an incorrectly formatted item amount.

the script i am using is as follows:

$browser = "https://www.paypal.com/xclick/business=mgrimes\@worcesterdiocese.org&item_name=$in{'item_name'}&item_number=$in{'item_name'}=&on0=$in{'on0'}&os0=$in{'os0'}&amount=$in{'amount'}&no_shipping=0&no_note=1¤cy_code=USD";
print "Location: $browser\n\n";


<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Andrew Chang
[br]It has to do with what you are using there are a few problems

1 you are using a hyperlink this is not what you need to use you only need to enter the web address

2 the @ symbol will not work in a cgi script because it will look for the @worcesterdiocese.org array which will be empty therefore sending only mgrimes use %40 or \@
I have posted the proper code below

3. If you plan on passing difrent values in the item_name,item_number, amount, on0 and os0 you can not hard coded values

set them to $in{'fieldname'} fieldname would = the actual field name example. item_name=$in{'item_name'} this will alow the field to be filled in from the form information

$browser = "https://www.paypal.com/xclick/business=mgrimes%40worcesterdiocese.org&item_name=Annual+Partners+In+Charity&item_number=store+id+&amount=&on0=City+Parish&os0=City+Parish&no_shipping=0&no_note=1¤cy_code=USD";
print "Location: $browser\n\n";

Do you see how the code works?

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#13 Andrew Chang

Andrew Chang

    Average Member

  • Members
  • 738 posts

Posted 07 March 2005 - 12:27 PM

May I view the page you are using to test?


Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems

#14 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 07 March 2005 - 12:30 PM

http://www.partners-...donate_new.html

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Andrew Chang
[br]May I view the page you are using to test?


Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

#15 Andrew Chang

Andrew Chang

    Average Member

  • Members
  • 738 posts

Posted 07 March 2005 - 12:41 PM

You are missing an important part of the script look at these lines in the script.

if ($in{'amount'} eq "texta") {
$in{'amount'} = $in{'texta'};
}
if ($in{'amount'} eq "dropa") {
$in{'amount'} = $in{'dropa'};
}



Do you see the radio buttons next to the fields on my example form.

This lets the user choose what kind of donation he/she wants to make
if the user selects to enter their own amount the script sees this and fills in the amount field with the value from the text box.

if the user selects a predefined value it sees this and fills it in with theat value.

I would suggest going back to the example and looking at all the elements to figure out exactly what is going on and how it is working.


http://paypaldev.org...p?TOPIC_ID=8146

the other problem is that , in your values 5,000.00 should be 5000.00

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems

#16 jpwebdesigner

jpwebdesigner

    Member

  • Members
  • PipPip
  • 13 posts

Posted 07 March 2005 - 02:16 PM

this worked, thanks. is there a way for me to prepopulate shipping, name, email, phone info?

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Andrew Chang
[br]You are missing an important part of the script look at these lines in the script.

if ($in{'amount'} eq "texta") {
$in{'amount'} = $in{'texta'};
}
if ($in{'amount'} eq "dropa") {
$in{'amount'} = $in{'dropa'};
}



Do you see the radio buttons next to the fields on my example form.

This lets the user choose what kind of donation he/she wants to make
if the user selects to enter their own amount the script sees this and fills in the amount field with the value from the text box.

if the user selects a predefined value it sees this and fills it in with theat value.

I would suggest going back to the example and looking at all the elements to figure out exactly what is going on and how it is working.


http://paypaldev.org...p?TOPIC_ID=8146

the other problem is that , in your values 5,000.00 should be 5000.00

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannounce....com/affiliates http://scorpionwebho...g.com/affiliate
Free Web Traffic: http://www.trafficsw...m/go.cgi?169137 , http://www.ts25.com/...ScorpionSystems
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users