I am using twitter bootstrap from wizard, and i want to submit 4 form in wizard,
http://vadimg.com/twitter-bootstrap-wizard-example/examples/basic-formvalidation.html#
Below is my code on each next button press,
onNext: function (tab, navigation, index) {
if(index == 1) {
if(form_header.valid() === true) {
$('#report_header_fm').submit(function(){
console.log('test123');
$.ajax({
type: "POST",
url: baseURL + "index.php/addNewReport",
data: $("#report_header_fm").serialize(),
success: function(data)
{
console.log('test');
}
}); //Ajax end
});
}
else
{
return false;
}
}
handleTitle(tab, navigation, index);
},
I have form with 5 inputs and id=report_header_fm,
Now when i click on next, i can see form validation occurs but form does not get submitted, Note- I am not clicking on submit button but there is next button–
<input type="submit" class="btn green-haze" value="Save">
So what i want is to submit a form when clicked on next, here validation occurs when click on next but submit is not happening,
I could not see ‘test123’ in console,
In short, how do i submit form without hitting submit button?
Thanks,
3
Answers
Here is a list of things you can change here to make it work, hopefully. Try it out.