home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

How to incorporate a CSS rollover into a form button?

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2083
Discussions: 200,973, Posts: 2,379,785, Members: 246,337
Old April 11th, 2007, 11:35 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Jun 2004
Posts: 178
How to incorporate a CSS rollover into a form button?

Hi

I want to change the standard 'SUBMIT' form button into a CSS rollover graphic.

I have used the CSS rollover button in other parts of the site, and it works fine:

<div class="rightrollover">
<a href="http://www.mysite.com.au/cart.php?page=faq">FAQ</a>
<a href="http://www.mysite.com.au/cart.php?page=faq#postage">Shipping </a>
<a href="http://www.mysite.com.au/cart.php?page=faq#exchange">Refunds</a>
<a href="cart.php?target=help&mode=contactus">Contact </a>
</div>

--------------------------
CSS:
---------------------------

.rightrollover a {
display:block;
width: 82px;
font: bold 13px sans-serif;
margin-top: 10px;
margin-left: 52px;
text-align:center;
color:#333;
background:url(http://www.mysite.com.au/rightbutton.gif) 0 0 no-repeat;
border:0;
text-decoration: none;
padding: 5px 20px 11px 3px;
}
.rightrollover a:hover {
color: #69DB33;
}
.rightrollover a:active {
background-position: 0 -34px;
color:#FDD99E;
padding: 8px 23px 8px 0px;
}
---------------------------------------------------------------

What I am unsure of is how to incorporate it into the form (currently has a static image as the button):

<input type="image" name="Submit" value="Submit" src="http://www.mysite.com.au/buttongraphic.jpg" border="0" />

Can it be done?

Cheers

Shaun
__________________
I'm looking for a male vocalist to work with. Go to http://people.aapt.net.au/celebritymusic/s...ikingsmith.html to email me
celebritymusic is offline   Reply With Quote
Old April 12th, 2007, 12:24 AM     #2 (permalink)
ph34r t3h g04t
 
Whir's Avatar
 
Join Date: Oct 2001
Location: Kingsford, MI
Posts: 19,571
Blog Entries: 7
Not sure if it will work or not, but try changing the url in rollover a to the static image, and adding the background:url(.gif) to rollover a:hover. You shouldn't need a:active, is that even supported in the latest XHTML?

Then just do a class="rollover" in the <input> tag and take out the src=.

That also may not work at all, since you're not using an <a> tag.

You can try just having rollover and rollover:hover as well.
Whir is offline   Reply With Quote
Old April 12th, 2007, 12:36 AM     #3 (permalink)
Super Stealthy Moderator
 
RicheemxX's Avatar
 
Join Date: Jan 2003
Location: Outside the box
Posts: 5,560
Blog Entries: 4
Send a message via Yahoo to RicheemxX
will this work for ya
<input type="image" name="Submit" value="Submit" src="images/buttonimage.gif" onmouseover="this.src='/images/hoverimage.gif'" onmouseout="this.src='/images/buttonimage.gif'">

or something like that anyways... it has been a long day
__________________
“Every question involves someone having to work for an answer, isn't it about time you did your share”
"Non-technical questions sometimes don't have an answer at all."
Linus Torvalds

Last edited by RicheemxX : April 12th, 2007 at 01:15 AM.
RicheemxX is offline   Reply With Quote
Old April 12th, 2007, 01:34 AM     #4 (permalink)
ph34r t3h g04t
 
Whir's Avatar
 
Join Date: Oct 2001
Location: Kingsford, MI
Posts: 19,571
Blog Entries: 7
Ah! Javascript is cheating!





Can't believe I forgot that. ~_~
Whir is offline   Reply With Quote
Old April 12th, 2007, 01:41 AM     #5 (permalink)
Super Stealthy Moderator
 
RicheemxX's Avatar
 
Join Date: Jan 2003
Location: Outside the box
Posts: 5,560
Blog Entries: 4
Send a message via Yahoo to RicheemxX
well yeah it is but ya know
RicheemxX is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash Rollover Expansion yochanda Graphic Design and Digital Photography 2 August 25th, 2006 04:53 AM
PS3 to Incorporate PhysX Tech JimRune Game News Discussion 2 March 23rd, 2006 11:29 AM
Different behaviour between Search button, & enter key on form Nathan323 Webmastering and Programming 5 November 3rd, 2005 09:01 PM
When are Mobos gonna incorporate PCI Express? glover12 Motherboards 0 June 16th, 2004 03:06 PM
problem with Back button after form submission rh71 Webmastering and Programming 2 April 8th, 2003 05:03 PM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3060)
Charges against non-tippers dropped.. (8)
The disrespect of Obama by Russian .. (49)
Delete an OS (16)
Nvidia GTX 260 problem (8)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (17)
Regular Build (11)
Point and Shoot Camera Suggestions. (7)
windows 7 problem (7)
Internet Lost (5)
Multiple Restarts Required at Boot (5)
Recent Discussions
Multiple Restarts Required at Boot (5)
Point and Shoot Camera Suggestions. (7)
Delete an OS (16)
cell phone won't work (0)
Nvidia GTX 260 problem (8)
Is the PSU I received dead? (15)
Can't open Word (12)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (37)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
windows vista security holes (17)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
help me pls laptop just stopped worki.. (0)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)
virus blocking exe. files (1)
CPU fan stops spinning randomly (11)
Modern Warfare 2: Who Bought It? (65)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)


All times are GMT -4. The time now is 11:27 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28