I\'m trying to stay on a specif tab ( in this case tab2 ) but after clicking the submit button the tab reverts to tab 1 which has the default class of active. I have hit a b
Use JQuery.ajax() in your Submit button's onclick()
event to post-back values asynchronously. That way, there won't be a window reload, as the postback will occur in the background.
HTML
JavaScript
function submit(){
$.ajax({
type: "POST",
url: "submit.php",
data: { param1: "param1", param2: "param2" }
}).done(function() {
alert( "Submitted" );
});
}