Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

Image rollovers for submit buttons?

Javascript coding ..

Moderators: macek, egami, gesf

Image rollovers for submit buttons?

Postby JediBookworm » Sun Sep 21, 2003 9:49 pm

Hi

I would like to create a submit button using an image with rollovers.

Here is the code:

Code: Select all
<input type="image"  src="layout/go.gif" name="submitbutton" value="Go" onMouseOver="document.submitbutton.src = 'layout/go2.gif'" onMouseOut="document.submitbutton.src = 'layout/go.gif'">


However, it produces the error that "document.submitbutton" is null or not an object.

How do i fix this?

Thanks
JediBookworm
New php-forum User
New php-forum User
 
Posts: 13
Joined: Mon Jun 30, 2003 3:54 pm
Location: Canada

Postby Redcircle » Mon Sep 22, 2003 7:45 am

The only thing that I can think of is that <input> tags cannot have an onmouse event on them.. I have a work around tho.
Code: Select all
<a href="javascript:form.submit();" onmouseover="document.the_form.subbutton.src ='layout/go2.gif';"
onmouseout="document.the_form.subbutton.src
= 'layout/go.gif';"><img src="layout/go.gif" name="subbutton" border="0" ></a>
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby JediBookworm » Mon Sep 22, 2003 3:48 pm

Thanks!
JediBookworm
New php-forum User
New php-forum User
 
Posts: 13
Joined: Mon Jun 30, 2003 3:54 pm
Location: Canada


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.