Skip to content

Instantly share code, notes, and snippets.

@rhyzx
Last active December 20, 2015 12:09
Show Gist options
  • Save rhyzx/6129000 to your computer and use it in GitHub Desktop.
Save rhyzx/6129000 to your computer and use it in GitHub Desktop.
<h1>Fix multi button:submit for IE6</h1>
<form action="">
<button type="submit" name="s" value="1">S1</button>
<button type="submit" name="s" value="2">S2</button>
</form>
<!--[if lt IE 7]>
<script>
$('button:submit[name]').click(function () {
var $this = $(this)
$('button:submit', this.form).removeAttr('name')
$this.attr('name', $this.data('_name'))
}).each(function () {
var $this = $(this)
$this.data('_name', $this.attr('name'))
})
</script>
<![endif]-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment