"jquery form submit plugin "
Bootstrap 4.1.1 Snippet by anuragsingh

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <form class="form-horizontal"> <fieldset> <!-- Form Name --> <legend>Form Name</legend> <!-- Text input--> <div class="form-group"> <label class="col-md-12 control-label" for="name">Name</label> <div class="col-md-12"> <input id="name" name="name" type="text" placeholder="Name" class="form-control input-md" required=""> <span class="help-block">Name</span> </div> </div> <!-- Text input--> <div class="form-group"> <label class="col-md-12 control-label" for="email">Email</label> <div class="col-md-12"> <input id="email" name="email" type="text" placeholder="Email" class="form-control input-md" required=""> <span class="help-block">Email</span> </div> </div> <!-- Textarea --> <div class="form-group"> <label class="col-md-12 control-label" for="message">Message</label> <div class="col-md-12"> <textarea class="form-control" id="message" name="message"></textarea> </div> </div> <!-- Button (Double) --> <div class="form-group"> <label class="col-md-12 control-label" for="submit"></label> <div class="col-md-12"> <button id="submit" name="submit" type="submit" class="btn btn-success">Submit</button> <button id="reset" name="reset" type="reset" class="btn btn-danger">Reset</button> </div> </div> </fieldset> </form> </div> </div> <script> $( document ).ready(function() { $( 'form' ).enquiryFormSubmission({ name:'name', email:'email', message:'message', companyId: 2500 }); }); </script>
(function($) { $.fn.enquiryFormSubmission = function(options ) { // Establish our default settings var settings = $.extend({ name:'name', email:'email', message:'message', form:this, companyId:null }, options); this.find('input[type="submit"],button[type="submit"] ').click(function(event){ event.preventDefault(); console.log(settings); $.ajax({ type : 'POST', url : '127.0.0.1/anuragform.php', data : $('#form').serialize() + "&par1=1&par2=2&par3=232" } }); } }(jQuery));

Related: See More


Questions / Comments: