How can I submit a specific form using the follow code (example the id of my form is #form1).
$(".nextbutton").click(function() { submit; }); Try this lets say your form id is formID
$(".nextbutton").click(function() { $("form#formID").submit(); }); submit that is a shortcut for .trigger('submit') and submits the form.You can try like:
$("#myformid").submit(function(){ //perform anythng }); Or even you can try like
$(".nextbutton").click(function() { $('#form1').submit(); }); Since a jQuery object inherits from an array, and this array contains the selected DOM elements. Saying you're using an id and so the element should be unique within the DOM, you could perform a direct call to submit by doing :
$(".nextbutton").click(function() { $("#formID")[0].submit(); }); You don't really need to do it all in jQuery to do that smoothly. Do it like this:
$(".nextbutton").click(function() { document.forms["form1"].submit(); });