Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouseovers and <input type='image'> ?

Status
Not open for further replies.

KenKasmar

MIS
Feb 3, 2000
27
US
Has anybody had any success doing mouseovers with images used as submit buttons in a form? Below is an example of what I attempted that blows up...

<form action='post.htm' method='post' name='specialform'>
<image type='image' src='button.gif' width=85 height=20 border=0 align='middle' name='gothere' onMouseOver=&quot;document.specialform.gothere.src='button_on.gif'&quot; onMouseout=&quot;document.specialform.gothere.src='button.gif'&quot;>
</form>

The Jscript error I get says that document.specialform.gothere is null or not found.

Any suggestions would be greatly appreciated!!

Thanks,
Ken Kasmar
Red Falcon Internetworking, Inc. [sig][/sig]
 
Excuse me... Can you specify in which browser this happens (with version)? I've tried current versions of Netscape and IE, but found no error... [sig]<p>Michael Dubner<br>Brainbench MVP/HTML+JavaScript<br>
[/sig]
 
I made a slight boo boo... Here is the code that I am actually trying to get to work:

<form action='post.htm' method='post' name='specialform'>
<input type='image' src='button.gif' width=85 height=20 border=0 align='middle' name='gothere' onMouseOver=&quot;document.specialform.gothere.src='button_on.gif'&quot; onMouseout=&quot;document.specialform.gothere.src='button.gif'&quot;>
</form>

Thanks,
Ken Kasmar
Red Falcon Internetworking, Inc.

[sig][/sig]
 
Ken:

What I've found to work (at least in IE - see my newest posting...) is to not use input type=image, but to use an image and on click activate a function (in my case it validates the data, then submits) that ends with document.form.submit().

Let me know what you think.

Ben [sig][/sig]
 
This is how we used one on our index page, where a customer inputs logon name and password. :

<tr>
<TD width=&quot;70&quot; align=&quot;right&quot;><FORM name=&quot;login&quot; method = &quot;post&quot; ACTION = &quot;login.asp?task=entered&quot; target=&quot;main&quot; OnSubmit=&quot;clearFields()&quot;>
E-Mail</TD>
<TD><INPUT TYPE=&quot;TEXT&quot; NAME=&quot;emailV&quot; SIZE=&quot;14&quot;><input type=&quot;hidden&quot; name=&quot;email&quot;></td>
<td> </td>
</TR>
<tr><td></td></tr>
<TR>
<TD align=&quot;right&quot; valign=&quot;top&quot;>Password</TD>
<TD valign=&quot;top&quot;><INPUT TYPE=&quot;PASSWORD&quot; NAME=&quot;passwordV&quot; SIZE=&quot;14&quot;> </TD>
<TD valign=&quot;center&quot;><INPUT TYPE=&quot;image&quot; src=&quot;graphics/button_go.gif&quot; NAME=&quot;SUBMIT&quot; VALUE=&quot;Lookup&quot; border=&quot;0&quot;><input type=&quot;hidden&quot; name=&quot;password&quot;></td>
</TR>
</Form>


See if that works. Good luck! [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top