I have been modifying my companys web site and I have a question about Forms. On my site you can buy products and the "Add to cart" button is the default grey buttons. I would like to change these default buttons to a more colorful button that I have seen on other sites. Can anyone give me some ideas on how to do this or where i can go to learn how to change these buttons?

Erik Schrank

12 Years
Discussion Span
Last Post by JameB

Make any link, image, button, or other "widget" a submit button by simply attaching JavaScript to it.

For example, a hyperlink can be:

<a href="" onclick="myForm.submit()">Submit me!</a>

The key is that the form has a "submit" method, that you can call from almost anywhere.


javscript is so passe, so blockable, so insecure -=resides on the user browser

input.submit {background: bla bla bla; color: bla bla bla; width:bla; height;bla; /* any other css bla bla bla */ }
input.submit:hover {background: otherbla bla bla; color: otherbla bla bla; width:bla; height;bla}
input.submit:active {background: otherotherbla bla bla; color: otherotherbla bla bla; width:bla; height;bla}
input.submit:focus {background: otherbla bla bla; color: otherbla bla bla; width:bla+10; height;bla+5}[

Edited by almostbob: n/a


You can put use the <button></button> tag around an image.

     <IMG SRC="/this/leads/to/your/button/image/!!" HEIGHT="97" WIDTH="105" ALT="Starflower" ALIGN="ABSMIDDLE"><STRONG>Keep this blank or not...</STRONG></BUTTON>

Difference Between the <input> Tag and <button> Tag:
At first glance, it may appear that there's not much difference between using the <button> tag and <input> tag. But there are some differences.

The main difference is that the <button> tag allows you to place HTML code in between the opening and closing tags. The <input> tag is an empty tag (i.e. it doesn't have a closing tag), so you can't add content to the tag.

Another key difference between the two tags is with the value attribute. The <input> tag uses this attribute to display a label on the button (e.g. "Click me!"). With the <button> tag, on the other hand, the value attribute is submitted along with any form contents and can be used for processing.


Edited by JameB: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.