Handle form submit event
Description
The following code shows how to handle form submit event.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.4.js'></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css">
<script type='text/javascript'
src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script type='text/javascript'>
$(window).load(function(){<!--from w ww . j a v a2 s .co m-->
$(document).delegate('form', 'submit', function (e) {
e.preventDefault();
alert('Form Submitted');
});
});
</script>
</head>
<body>
<form action="" data-ajax="false">
<div data-role="page">
<div data-role="content">
<input type="submit" value="Submit" />
</div>
</div>
</form>
</body>
</html>