PDA

View Full Version : Image swap with a submit button.


YFS200
04-07-2001, 03:23 AM
I am working on a voting script(perl), for internal use. Plans are to put it on a SSL and password protected area on the site for employees to use.

Basic 3 buttons. Yes, No, and Whatever. I made some cool buttons in Photoshop and set up a mouseover to swap the images.

So far so good. Even got approval from the boss. Even likes my buttons. :)

Now I am trying to set it up so that each button submits a forum.
I figured out how to make each button submit. But I can't get the image swap to work when the images are submit buttons.

Any suggestions?
Thanks

YFS200
[nbsp][nbsp][nbsp][nbsp]

Rich
04-07-2001, 12:23 PM
I don't believe submit actions can have a mouseover event attached to them. You can, however, use the images as links instead:

<a href=/cgi-bin/yourscript?button=1&quot;><img src=&quot;images/yourimage.gif&quot;></a>

Rich

YFS200
04-07-2001, 03:04 PM
That was my second thought. The only drawback is that a lot of information I don't want shown will appear on the URL line.[nbsp][nbsp]Maybe I can hid it with some Javascript.

Thanks
YFS200

janderk
04-08-2001, 08:16 AM
I'm not sure if this will help you, but you could use JavaScript in the <a> tag.

<a href=&quot;javascript: void 0&quot;
[nbsp][nbsp]onMouseDown=&quot;document.images['yourimage'].src='up.gif'&quot;
[nbsp][nbsp]onMouseUp=&quot;document.images['yourimage'].src='up.gif'&quot;
[nbsp][nbsp]onMouseOut=&quot;document.images['yourimage'].src='up.gif'&quot;
[nbsp][nbsp]onClick=&quot;Your JavaScript&quot;><img SRC=&quot;up.gif&quot; NAME=&quot;yourimage&quot; BORDER=0 height=29 width=29></a>

Jan Derk