Skip to content

Instantly share code, notes, and snippets.

@mikedfunk
Created April 9, 2012 16:18
Show Gist options
  • Save mikedfunk/2344500 to your computer and use it in GitHub Desktop.
Save mikedfunk/2344500 to your computer and use it in GitHub Desktop.
IE Multiple Submit Button Test
<!doctype HTML>
<html>
<head>
<title>IE Submit button test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<style type="text/css">
body {
padding: 40px;
}
</style>
</head>
<body>
<h1>IE Multiple Submit Button Test</h1>
<hr />
<form method="post" action="<?=$_SERVER['SCRIPT_NAME']?>" class="form-horizontal">
<input type="text" name="test_input" value="test" />
<button name="action" value="value one" class="btn" type="submit">Submit One</button>
<button name="action" value="value two" class="btn" type="submit">Submit Two</button>
</form>
<?php
// if post is set, show the action value
if (count($_POST) > 0): ?>
<p class="alert alert-success">Action is <strong><?=$_POST['action']?></strong></p>
<?php
// otherwise post is not set, just show a placeholder
else: ?>
<p class="alert">Click a submit button</p>
<?php endif; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment