Skip to content

Instantly share code, notes, and snippets.

@godfat
Created May 26, 2009 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godfat/117867 to your computer and use it in GitHub Desktop.
Save godfat/117867 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-TW">
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
<title>test jquery submit event hook</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"/>
<script type="text/javascript">
$(document).ready(function(){
$('#s1').click(function(){
if(confirm('XD')) $('#form').submit()
else return false
})
})
</script>
</head>
<body>
<form id="form" action="action">
<p><input id="s1" value="1" type="submit"/></p>
<p><input id="s2" value="2" type="submit"/></p>
<p><input id="s3" value="3" type="submit"/></p>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment