|
|
|
Rank: Starting Member
Groups: Registered
Joined: 7/11/2003 Posts: 4 Location: ,
|
paypal was kind enough to supply me with the following code to replace the image input line:
<a href="#" onclick="submit()">example of text</a>
however when I use it to replace the image input line, and you click on it, nothing happens. is there something else I need to do?
thanks in advance
|
|
|
|
|
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 11/24/2002 Posts: 2,004 Location: ,
|
Well, if that statement works anywhere it is a shortcut and not the normal way. "submit" is a method associated with a FORM, and should be addressed that way.
From within a FORM the format is "this.form.submit();". But this may be used only by elements that are FORM members (<a is not a FORM member!)
You may also submit FORMs from outside a FORM (or from nonFORM members), and in this case the format is "document.formname.submit();", where "formname" is the name you have given the FORM.
In other words, the "submit();" method requires a reference to which FORM it is you want to submit.
Note to remember - using the "submit()" method will not activate the "onsubmit" event handler of the FORM!
Is there something else you need to do? yes. Give the FORM a name, and use the "document.formname.submit()" format.
Ron.
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 7/11/2003 Posts: 4 Location: ,
|
thanks. let me clarify. in the code below, instead of using a paypal donation button, I would like to use text as a link if possible. what would the code be?
thanks again
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="destroy@freerockandroll.com"> <input type="hidden" name="item_name" value="payment for audio files"> <input type="hidden" name="item_number" value="1"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://www.freerockandroll.com"> <input type="hidden" name="cancel_return" value="http://www.freerockandroll.com"> <input type="hidden" name="cn" value="comments"> <input type="hidden" name="cs" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="tax" value="0"> <input type="image" src="https://www.paypal.com/images/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> </form>
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 9/16/2002 Posts: 2,960 Location: ,
|
<form name="myForm" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type=hidden name="cmd" value="_xclick"> <input type=text name="business" value="pay@site.com"> <input type=hidden name="item_name" value="Widget"> <input type=hidden name="amount" value="1.00"> </form> <a href="#" onClick="document.myForm.submit(); return false">Submit</a> Patrick Breitenbach PayPal, Inc. Dev Net: https://www.paypal.com/pdn
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 11/24/2002 Posts: 2,004 Location: ,
|
I understand. Your page must have that FORM somewhere in it. What you want to do is to replace the <input type="image" button with a text ref (<a).
All I am saying is that your <a reference to that FORM (no matter where - inside the FORM or not) needs to be of the format...
<a href="#" onclick="document.formname.submit();">text</a>
where you replace "formname" with a name you have given to the FORM.
Ron.
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 11/24/2002 Posts: 2,004 Location: ,
|
Yeah - what Patrick said (we were typing at the same time.)
Ron.
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 7/11/2003 Posts: 4 Location: ,
|
thanks, you guys. I've done that - but it still doesn't work:
<form name="myForm" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="destroy@freerockandroll.com"> <input type="hidden" name="item_name" value="payment for audio files"> <input type="hidden" name="item_number" value="1"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://www.freerockandroll.com"> <input type="hidden" name="cancel_return" value="http://www.freerockandroll.com"> <input type="hidden" name="cn" value="comments"> <input type="hidden" name="cs" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="tax" value="0"> </form> <a href="#" onClick="document.myForm.submit(); return false">Submit</a>
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 11/24/2002 Posts: 2,004 Location: ,
|
It worked OK for me. Only thing is that you have no amount, but I got to PayPal. Give me a minute and I'll put it up for you... Here ya go (right-click to see source). http://members.aol.com/paypaltester/tst1.htm
Ron.
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 7/11/2003 Posts: 4 Location: ,
|
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 4/29/2004 Posts: 2 Location: ,
|
Hello,
I'm trying to do the same thing (text ilo button for PayPal).
I'm using WordPerfect as my HTML editor (probably my first mistake) and I can get the text "button" to work as long as I don't debug. Once I debug, the stupid program removes the "action="https . . ." from the "form name=" line.
Please help!!!
|
|
|
|
Guest
|
YAFVision Theme by Jaben Cargman (Tiny Gecko)Powered by YAF |
YAF © 2003-2009, Yet Another Forum.NETThis page was generated in 0.685 seconds.