Clickable pushed button

Al_sarvi
Al_sarvi used Ask the Experts™
on
Is there any way that I can careat a button that when somebody clicks on it, it looks like it is pushed..
I am lookig for a good flexible code that let me write my own text on the button or change its color and so on.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I believe you can create it as a rollover state but use "on click" rather than "on mouseover".

Commented:
al_sarvi,

<FORM>
<INPUT type="button" value="Change to Yellow!" name="button3" onClick="document.bgColor='yellow'"> <br>
</FORM>


i include some code.

hope it help!

Author

Commented:
lovemeto,

I know HTML and thanks for the code. I was just wondering if I can change color of the button or format of its text. There might be some flexible code generator somewhere that gets color, size and text and is able to create more beautiful 3-d button that when you click on it, it seems button is going inside and is being pushed. I think some Javascipt code is needed to change the origal image of button to the pushed image when it is clicked.

Thanks,

Al
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Commented:
You can use an image on a button, see the wonderful tutorials at http://www.w3schools.com

Hope this helps

Marion
Commented:
Found this code from Codelifter.com:

--------------------------------------------------------
Script:  Active Tri-State Roll-Over Images on Form Submit and Reset
         Script Boilerplate and Quick-Take Tutorial
         
Source:  (C) 2001 by CodeLifter.com at http://www.codelifter.com

Author:  etLux

Desc.:   This script shows how to use tri-state rollover images with
         forms, instead of the usual rather unattractive 'gray
         buttons' for Submit and Reset.
---------------------------------------------------------

Follow the link to the code: http://www.codelifter.com/main/javascript/formimagebuttons1.html

Looks cool. Think I'll find a use for it myself!
Good luck-
-6-



Commented:
Style sheets are the way to go for this.  Have a look at www.jabaily.com.  I did not change the style while active, at that site, but could have.

Commented:
My experience is that a java script will give the false impression of a "sunken" effect, and for some applications that might be the way to go.

The thing is that the Java script won't change the style of the font, nor will it fill in small details of a 3D button.

My advise would be to create two graphics, which Photoshop will easily do --- one button that is up, and one button that is down.  Then use the HTML code to change between the two.

It also happens to be the lightest code size.  For Java to simulate it takes that much more code in your page.

Commented:
looks to me like there were some answers here and that it is just that the questioner did not award points.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial