YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

text instead of a button Options
love666
#1 Posted : Friday, July 11, 2003 4:04:52 PM
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
Sponsor  
 
ron
#2 Posted : Friday, July 11, 2003 4:33:35 PM
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 (&lt;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.
love666
#3 Posted : Friday, July 11, 2003 4:38:02 PM
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

&lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;input type="hidden" name="cmd" value="_xclick"&gt;
&lt;input type="hidden" name="business" value="destroy@freerockandroll.com"&gt;
&lt;input type="hidden" name="item_name" value="payment for audio files"&gt;
&lt;input type="hidden" name="item_number" value="1"&gt;
&lt;input type="hidden" name="no_shipping" value="1"&gt;
&lt;input type="hidden" name="return" value="http://www.freerockandroll.com"&gt;
&lt;input type="hidden" name="cancel_return" value="http://www.freerockandroll.com"&gt;
&lt;input type="hidden" name="cn" value="comments"&gt;
&lt;input type="hidden" name="cs" value="1"&gt;
&lt;input type="hidden" name="currency_code" value="USD"&gt;
&lt;input type="hidden" name="tax" value="0"&gt;
&lt;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!"&gt;
&lt;/form&gt;
paypal_pb
#4 Posted : Friday, July 11, 2003 4:38:28 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
&lt;form name="myForm" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;input type=hidden name="cmd" value="_xclick"&gt;
&lt;input type=text name="business" value="pay@site.com"&gt;
&lt;input type=hidden name="item_name" value="Widget"&gt;
&lt;input type=hidden name="amount" value="1.00"&gt;
&lt;/form&gt;

&lt;a href="#" onClick="document.myForm.submit(); return false"&gt;Submit&lt;/a&gt;

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
ron
#5 Posted : Friday, July 11, 2003 4:44:41 PM
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 &lt;input type="image" button with a text ref (&lt;a).

All I am saying is that your &lt;a reference to that FORM (no matter where - inside the FORM or not) needs to be of the format...

&lt;a href="#" onclick="document.formname.submit();"&gt;text&lt;/a&gt;

where you replace "formname" with a name you have given to the FORM.

Ron.
ron
#6 Posted : Friday, July 11, 2003 4:51:14 PM
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.
love666
#7 Posted : Friday, July 11, 2003 4:56:36 PM
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:

&lt;form name="myForm" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;input type="hidden" name="cmd" value="_xclick"&gt;
&lt;input type="hidden" name="business" value="destroy@freerockandroll.com"&gt;
&lt;input type="hidden" name="item_name" value="payment for audio files"&gt;
&lt;input type="hidden" name="item_number" value="1"&gt;
&lt;input type="hidden" name="no_shipping" value="1"&gt;
&lt;input type="hidden" name="return" value="http://www.freerockandroll.com"&gt;
&lt;input type="hidden" name="cancel_return" value="http://www.freerockandroll.com"&gt;
&lt;input type="hidden" name="cn" value="comments"&gt;
&lt;input type="hidden" name="cs" value="1"&gt;
&lt;input type="hidden" name="currency_code" value="USD"&gt;
&lt;input type="hidden" name="tax" value="0"&gt;
&lt;/form&gt;
&lt;a href="#" onClick="document.myForm.submit(); return false"&gt;Submit&lt;/a&gt;
ron
#8 Posted : Friday, July 11, 2003 5:05:26 PM
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.
love666
#9 Posted : Friday, July 11, 2003 5:22:08 PM
Rank: Starting Member

Groups: Registered

Joined: 7/11/2003
Posts: 4
Location: ,
thanks a lot!
Richard Horton
#10 Posted : Thursday, April 29, 2004 1:13:56 PM
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!!!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.685 seconds.