Click to See Complete Forum and Search --> : Submit Button Help :confused:
I need to have an image for a submit button and when you hover over it will change to a different image of the same size. So its basicly a hover button but its also the submit button for my form. I tried varies ways to try to accomplish this but all attempts seem to have faild. I'm sure it is something very simple that I'm missing but can someone please help me out and post a code for me or let me know exactally what I need to do? Thanks. :D
brendandonhue
05-04-2003, 12:58 PM
Heres a script I just wrote for this, replace submit1.gif and sumbit2.gif with the images that you want as the submit button. Replace formname with the name of the form you want to submit.
<img src="logo1.gif" name="image" onMouseOver="document.image.src='logo2.gif'" onMouseOut="document.image.src='logo1.gif'" onclick="document.formname.submit()">
Charles
05-04-2003, 01:06 PM
But that will make the form not work at all one in ten times. Use instead something like:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<form action="">
<div>
<input type="image" alt="submit" src="http://churchtimes.co.uk/images/books_up.gif" onmouseover="this.src='http://churchtimes.co.uk/images/books_over.gif'" onmouseout="this.src='http://churchtimes.co.uk/images/books_up.gif'">
<div>
</form>
brendandonhue
05-04-2003, 01:11 PM
Cool, I tried using input type=image but I couldnt get it working, I didnt know about using this.src.
Learn something new every day :)