Monday, December 31, 2012

Form Submit in Jquery


Below is a basic code sample of form submission using Jquery.

<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("form").submit(function(){
    alert("Submitted");
  });
});
</script>
</head>
<body>

<form action="">
First name:
<input type="text" name="Name" value="chamara"><br>
Last name:
<input type="text" name="Age" value="25"><br>
<input type="submit" value="Submit">
</form>

</body>
</html>

No comments:
Write comments
Recommended Posts × +