I can't catch submit event
Dear all , I wirte a simple sample to alert 'here' when catch submit event.
The code as below.
When I press submit button , it works fine.
But when I press b3 button , it will call a function to submit the form.
The form submit is ok , but it will not alert 'here'.
Are there something wrong with the code?
-
<title>ttttt</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.blockUI.v2.5.js"></script>
</head>
<script type="text/javascript">
$(document).ready
(
function()
{
$('#form1').submit
(
function()
{
alert('here');
}
);
}
);
function query(){
document.ListForm.submit();
}
</script>
<body>
<form name="ListForm" id="form1" method="post">
<input type="text">
<input type="button" id="demo3" value="b3" onclick="query();">
<input type="submit" id="submit1" value="submit">
</form>
</body>
</html>