This question already has an answer here:
- Submit a form using jQuery 22 answers
How can I submit a specific form using the follow code (example the id of my form is #form1).
$(".nextbutton").click(function() { submit; });
This question already has an answer here:
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(); });
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();
});
If you have only 1 form in you page, use this. You do not need to know id or name of the form. I just used this code - working:
document.forms[0].submit();
Use the following jquery to submit a selectbox with out a submit button. Use "change" instead of click as shown above.
$("selectbox").change(function() {
document.forms["form"].submit();
});
Cheers!
Try this :
$('#form1').submit();
or
document.form1.submit();