/    Sign up×
Community /Pin to ProfileBookmark

A difficult use of buttons and a form – can you help ?

Hi,

I want to alllow my clients to choose using
a radio button selector and then click on the paypal
button which sends in the form.

This is what I have:

[IMG]http://www.expert-world.com/sp/form.jpg[/IMG]

The problem is that I don’t know how to evaluate the
radio button and give the correct price before the
form is sent to paypal.

Should I be doing this with javascript or can I accomplish this with
PHP somehow. Seems that I need two forms one after the other
but I can not see how to write it ?

Any one got any ideas on this ?

I know how to make a form with radio buttons.

My problem is that to process that form
you have something like:

[code=php]<form action=”my_prog.php” method=”post”>[/code]

And my prog will process the radio button.

BUT.

With the paypal button on the same page (see image)
– I have to pass the processing over to paypal
and the form starts up with:

[code=php]<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post”>[/code]

So my question is how do I get both done ?

This is not as easy as it seems.

I need to find out the selection and assign price value and
product name by using the radio buttons then send the form to paypal.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@hastxSep 01.2009 — I'm not sure why would would have to collect any info before sending it to paypal?

you can just define your products in your paypal account, each of those should have an ID number. Your form can just post to paypal passing the id number of the product being purchased. Paypal should already know the price based on the ID number.
×

Success!

Help @jeddik spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...