View Full Version : why type="image" can't work under IE?

12-27-2010, 04:24 AM
$html .= '<div id="submit"><input type="image" name="subscribe" onmouseover="this.src=\'images/1_hv.jpg\'" onmouseout="this.src=\'images/1.jpg\'" src="images/1.jpg" value="'.$data["button"].'" onClick="return checkform();"></div> ';

why the type="image" code can't work under IE? when i click the image under IE, it can't work. it can't submit the form. but under firefox and chrome.it can work. how to correct it ?
when i change the input into

<input type="submit" name="subscribe" value="'.$data["button"].'" onClick="return checkform();">

when under IE,firefox,chrome. all can work

12-27-2010, 05:58 AM
You could try just adding a CSS style to the type="submit" since you know it works; i.e.,

<input type="submit" style="background:url('/someimage.png');width:160px;height:20px;border:1px solid #000000;" name="subscribe" value="'.$data["button"].'" onClick="return checkform();">

Other than that, I can't be of much help without the rest of your code.

12-27-2010, 06:00 AM
yeah use css to style buttons.

quick example.

<input type="submit" id="mybutton".........

#mybutton {

#mybutton:hover {

Old Pedant
12-27-2010, 06:36 AM
I use <input type=image> all the time with MSIE. I have no idea why you say it doesn't work.

I did notice that you were trying to give a value= to an <input type=image>, and that will never work. But other than that...

Possibly you have a bug in your checkForm() code?