Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Problem with button

Reply
Thread Tools

Problem with button

 
 
stax
Guest
Posts: n/a
 
      03-22-2007
Hello,
a PayPal button is typically a image, is it possible to use a real button?

thx
stax

This is the typical markup:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="(E-Mail Removed)">
<input type="hidden" name="item_name" value="StaxRip donation">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit">
<img border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>

Below is my real button attempt, I should mention I'm pretty clueless about web tech. It has two problems, first IE7 shows a warning about scripting and second it does not work.

<script language="JavaScript">
function goToPayPal()
{
window.document.forms[0].action = 'https:\/\/www.paypal.com\/cgi-bin\/webscr';
window.document.forms[0].submit();
}
</script>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="(E-Mail Removed)">
<input type="hidden" name="item_name" value="StaxRip donation">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF">
<input type="button" value="test" name="submit" onclick="goToPayPal()">
</form>
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-22-2007
Scripsit stax:

> a PayPal button is typically a image, is it possible to use a real
> button?


Surely. In rare cases, a server uses information about the coordinates of
the click on an image submit button, but in most situations, you can replace
it by a normal submit button.

> <input type="image"
> src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0"
> name="submit">


That's the image submit button.

> <input type="button" value="test" name="submit"
> onclick="goToPayPal()">


No, you don't need anything that complicated, and using JavaScript for form
submission would make the form non-functional when JavaScript execution is
disabled in browser settings.

Just use a normal submit button:

<input type="submit" value="Donate">

The value="..." attribute specifies the text that will appear in the button.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
 
J.O. Aho
Guest
Posts: n/a
 
      03-22-2007
stax wrote:
> Hello,
> a PayPal button is typically a image, is it possible to use a real button?
>
> thx
> stax
>
> This is the typical markup:
>
> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
> <input type="hidden" name="cmd" value="_xclick">
> <input type="hidden" name="business" value="(E-Mail Removed)">
> <input type="hidden" name="item_name" value="StaxRip donation">
> <input type="hidden" name="no_shipping" value="1">
> <input type="hidden" name="currency_code" value="EUR">
> <input type="hidden" name="tax" value="0">
> <input type="hidden" name="bn" value="PP-DonationsBF">


<button name="submit" type="submit" style="background-repeat: no-repeat;
background-position: left top; background-image:
img('https://www.paypal.com/en_US/i/btn/x-click-but04.gif')"
onclick="goToPayPal()">Press Here</button>

> <img border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif"
> width="1" height="1">
> </form>


Thats what you was looking for?
--

//Aho
 
Reply With Quote
 
stax
Guest
Posts: n/a
 
      03-22-2007
Jukka K. Korpela wrote:
> Scripsit stax:
>
>> a PayPal button is typically a image, is it possible to use a real
>> button?

>
> Surely. In rare cases, a server uses information about the coordinates
> of the click on an image submit button, but in most situations, you can
> replace it by a normal submit button.
>
>> <input type="image"
>> src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0"
>> name="submit">

>
> That's the image submit button.
>
>> <input type="button" value="test" name="submit"
>> onclick="goToPayPal()">

>
> No, you don't need anything that complicated, and using JavaScript for
> form submission would make the form non-functional when JavaScript
> execution is disabled in browser settings.
>
> Just use a normal submit button:
>
> <input type="submit" value="Donate">
>
> The value="..." attribute specifies the text that will appear in the
> button.
>


Detailed answer with simple solution, thanks!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax, changing text in a button, and button click problem Tim ASP .Net 0 07-23-2008 07:57 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Radio button List problem: How to find value of Radio button list's Selected Item using javascript?? Hiten ASP .Net Web Controls 1 05-26-2004 10:32 AM
HTML Reset Button Doesn't work after postback with Submit button Chris Lane ASP .Net 4 11-17-2003 11:52 PM
JavaScript Access to Button in form tags (webcontrol or html button) Wes Weems ASP .Net 1 07-20-2003 05:27 AM



Advertisments