C# ASP.NET SQL SERVER

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...

» Similar Posts

  1. HTML Submit button still submits even when JavaScript returns false
  2. Defeating Spam Bot with email names
  3. ASP.NET MVC with jQuery DynaTree plugin for Checkboxes

» Trackbacks & Pingbacks

    No trackbacks yet.
Trackback link for this post:
http://guyellisrocks.com/trackback.ashx?id=180

» Comments

  1. Jon Davis avatar

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

    Jon Davis — September 16, 2009 6:57 PM
  2. guy ellis avatar

    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.

    guy ellis — September 16, 2009 7:01 PM

» Leave a Comment