Justin Zwick
Justin Zwick

Reputation: 3

Odd browser compatibility issue with IE/Firefox

I have a login script based on PHP and Javascript. I couldn't figure out for the longest time why it would work in chrome and safari but not in firefox or internet explorer. I finally figured out the issue is with the html, instead of having the regular submit button I have an image for submit. and simply changing type="image" to type="submit" resolves the issue. Does anyone know why this is and if there's a compatible way to write the following

This works:

<input name="doLogin" type="submit" style="margin-left:90px;" id="doLogin3" value="Login">

This does not:

<input name="doLogin" type="image" src="login-btn.png" style="margin-left:90px;" id="doLogin3" value="Login">

Upvotes: 0

Views: 73

Answers (1)

qualebs
qualebs

Reputation: 1381

if you are not going to be using js to submit your form, then the input type for your submit button should be submit. but if you really must have an image in place of your button, just position the image with css by setting it as the background of your button. no need to change input type to image. hope that helps.

Upvotes: 1

Related Questions