Jilco Tigchelaar
Jilco Tigchelaar

Reputation: 2149

Jquery update div after form submit with same form and S_POST data

A have a page with 6 (Jquery) tabs and on each tab there is a form, i want to submit one of the forms without refreshing the whole page. When i submit a form i want to "reload" the same form in that tab, but with the $_POST data so i can use that for PHP scripting (database insert after vallidation).

I tried Jquery AJAX, but i have to define al the form ellement again to pass the POST data, is'nt there a way similar like action="" but then only for that one tab and not the whole page?

Upvotes: 0

Views: 369

Answers (1)

mccbala
mccbala

Reputation: 183

$('form').submit(function(e){ 
    e.preventDefault(); //to prevent the page form reloading

    //provide the ajax call part after this

    return false; // to exit the function without actually submitting the form
});

Upvotes: 1

Related Questions