How to Submit a Form Using Jquery?

Here we shall discuss how we are going to submit the form from a jquery program. Earlier, we had discussed <a href=”http://programmingbulls.com/how-submit-form-using-javascript”>how to submit a program using javascript</a>. Now, we shall discuss how to submit a program using Jquery.

Like javascript that provides the submit() method, we have a submit method in Jquery as well.

<h1>Jquery Submit() method Example</h1>
<javascript>
$(‘#formid’).submit(function() {
alert(‘I am submitted’);
return false;
});
</javascript>

In the code above, formid is the id of the form and we are attaching the submit() method to it.

The complete code would look like this:
<code>
<!DOCTYPE html>
<html>
<head>
<script src=”http://code.jquery.com/jquery-latest.js”></script>

</head>
<body>
<div id=”container”>

<form action=”submit.php”>
<div>
<input type=”submit” />
</div>
</form>
<span></span>
<script>

$(“form”).submit(function() {
alert(“This is a submit”);
return false;
});
</script>
</div>
</body>
</html>
</code>

how to submit a program using javascript. Now, we shall discuss how to submit a program using Jquery. Like" data-image="http://www.shoutability.com/wp-content/uploads/2017/04/Work-Out-Less-and-Look-Younger-F4X-Fitness-Plan.png" data-button=""> Share
css.php