Wednesday, September 16, 2009

IE input button tag on localhost

Just encountered a very weird bug in Internet Explorer (IE) with the input/button tag that manifests itself when deployed but does not exist when accessing a site on localhost. Makes no sense to me whatsoever.

The tag I had looked like this:

<button name="submit" value="submit" onclick="JavaScript:Search()"> Submit</button>

When developing and testing on IE this button did a POST back to the server when testing it against localhost. However, when deployed, the button would refuse to POST even though the JavaScript ran. What is strange about this is that it's browser specific and shouldn't be affected by the server that you're POST'ing to. This I do not understand.

When I changed the button to:

<input type="submit" name="submit" value="submit" onclick="JavaScript:Search()">Submit</input>

It started working in both environments. This mystery has yet to be solved...

2 comments:

  1. Yeaah buud!! Have a looksie .. www.jondavis.net/.../A-button-tag-is

    ReplyDelete
  2. Right - but why would it work on localhost and not when deployed to a remote server? That's what's confusing me the most and makes debugging tricky.

    ReplyDelete