[thelist] input type="image" vs. input type="button"

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Mon Aug 21 16:06:41 CDT 2006


		   This is probably because input type="image" is (with a few small differences) the same as input type="submit".
   If you're using Javascript anyway, I'd suggest putting a plain old image tag in there or a div with an image inside) and catching the onclick event on that element instead.

HTH,

Peter

				From: jono at charlestonwebsolutions.com

I would like to use a custom image for the button on the example form
below. Using an image for the button breaks the form's functionality, but
I am not sure why?

This does not work:

Select a topic:
Tell me more about...Page OnePage TwoPage ThreePage Four

onClick="location=document.example.topics.options[document.example.topics.selectedIndex].value;"
value="GO" />

This Does Work:

Select a topic:
Tell me more about...Page OnePage TwoPage ThreePage Four

onClick="location=document.example.topics.options[document.example.topics.selectedIndex].value;"
value="GO" />

What is it about custom images for form buttons that break the JavaScript
in the form? Is there an alterantive approach to what I have above that
will work?

Thanks,

Jono



More information about the thelist mailing list