F
Frank H. Shaw
It has come to my understanding javascript runs when page is first opens this
would be a problem if I use javascript in what I am trying to do: I need to
understand how this can be stoped so javascript runs when the user selects
the submit button which happens afterr the user has selected a option in the
two radiobuttons that ask the user to choices pricing by each or pricing by
dozen. The logic which parses the action of the radiobutton is inside a form
that is contained in a table the form is used to send standard information to
paypal server but what changes is the item number and price which is barried
in some hidden input fields inside the form: I would be using some IF ELSE
ENDIF logic around the two lines of HTML that changed depending on wich
option the user selected in the radiobutton - since it has come to my
understanding that javascript runs when page opens javascript my not be the
answer and I might have to use PHP unstead But if PHP is the answer then I
need it to run when information is being sent to paypal so this means it has
to happen at the client side like HTML does. I have pasted at the bottom of
this message the form code which is used to send up to paypal:
I have created several threads around my problem and questions previous to
this posting you can get all the treads just look for my name Frank H. Shaw
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="(e-mail address removed)">
<input type="hidden" name="item_name" value="Pro Style ATF Ankle Brace with
Universal Fit">
<input type="hidden" name="item_number" value="212-E">
<input type="hidden" name="amount" value="20.95">
<input type="hidden" name="return"
value="http://www.skolsportsshop.com/success.htm">
<input type="hidden" name="cancel_return"
value="http://www.skolsportsshop.com/cancel.htm">
<input type="hidden" name="currency_code" value="USD">
<input TYPE="image" SRC="https://www.paypal.com/images/sc-but-03.gif"
NAME="submit0"alt="Make payments with PayPal - it's fast, free and secure!"
width="124" height="26">
<input type="hidden" name="add" value="1">
</form>
As you can see the two lines need to change depending on the radiobutton
action taken by the user the following two lines from:
<input type="hidden" name="item_number" value="212-E">
<input type="hidden" name="amount" value="20.95">
As you can see the two lines need to change depending on the radiobutton
action taken by the user the following two lines To:
<input type="hidden" name="item_number" value="212-D">
<input type="hidden" name="amount" value="225.00">
I figured this logic could be done by using a IF ELSE ENDIF around the four
lines of code and done in javascript by building a conditional exprersion for
the IF based on the action of the radiobutton my conditional expersion would
look something like this (amount[1].checked) or might be the following might
work also (amount[1].value = 20.95) the amount is the name properity of
both the radiobuttons because they are in the same group [1] is the first
item in the array and value or checked is the actual properity being tested
in the IF - what comes before the amount I am not shure of if anything but
remember the radiobutton sits in side a table and is in one of the cells of
the table.
THANKS
would be a problem if I use javascript in what I am trying to do: I need to
understand how this can be stoped so javascript runs when the user selects
the submit button which happens afterr the user has selected a option in the
two radiobuttons that ask the user to choices pricing by each or pricing by
dozen. The logic which parses the action of the radiobutton is inside a form
that is contained in a table the form is used to send standard information to
paypal server but what changes is the item number and price which is barried
in some hidden input fields inside the form: I would be using some IF ELSE
ENDIF logic around the two lines of HTML that changed depending on wich
option the user selected in the radiobutton - since it has come to my
understanding that javascript runs when page opens javascript my not be the
answer and I might have to use PHP unstead But if PHP is the answer then I
need it to run when information is being sent to paypal so this means it has
to happen at the client side like HTML does. I have pasted at the bottom of
this message the form code which is used to send up to paypal:
I have created several threads around my problem and questions previous to
this posting you can get all the treads just look for my name Frank H. Shaw
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="(e-mail address removed)">
<input type="hidden" name="item_name" value="Pro Style ATF Ankle Brace with
Universal Fit">
<input type="hidden" name="item_number" value="212-E">
<input type="hidden" name="amount" value="20.95">
<input type="hidden" name="return"
value="http://www.skolsportsshop.com/success.htm">
<input type="hidden" name="cancel_return"
value="http://www.skolsportsshop.com/cancel.htm">
<input type="hidden" name="currency_code" value="USD">
<input TYPE="image" SRC="https://www.paypal.com/images/sc-but-03.gif"
NAME="submit0"alt="Make payments with PayPal - it's fast, free and secure!"
width="124" height="26">
<input type="hidden" name="add" value="1">
</form>
As you can see the two lines need to change depending on the radiobutton
action taken by the user the following two lines from:
<input type="hidden" name="item_number" value="212-E">
<input type="hidden" name="amount" value="20.95">
As you can see the two lines need to change depending on the radiobutton
action taken by the user the following two lines To:
<input type="hidden" name="item_number" value="212-D">
<input type="hidden" name="amount" value="225.00">
I figured this logic could be done by using a IF ELSE ENDIF around the four
lines of code and done in javascript by building a conditional exprersion for
the IF based on the action of the radiobutton my conditional expersion would
look something like this (amount[1].checked) or might be the following might
work also (amount[1].value = 20.95) the amount is the name properity of
both the radiobuttons because they are in the same group [1] is the first
item in the array and value or checked is the actual properity being tested
in the IF - what comes before the amount I am not shure of if anything but
remember the radiobutton sits in side a table and is in one of the cells of
the table.
THANKS