I want to submit a form that resides inside a jQuery UI tab - and I want the action page to render IN THE TAB... I was able to 'intercept' "a" tags inside the tabs to call those links into the tab (thanks to the help here...)
using this
$('#tabs-community').on('click', '.ui-tabs-panel a', function(){
var $panel=$(this).closest('.ui-tabs-panel');
$panel.load(this.href);
return false;
});
I presume there is something similar for the submit event... I tried THIS
$('#formID').on('submit', function(e){
e.preventDefault();
var formSrc = $(this).attr('action');
var formMethod = $(this).attr('method');
var formData = $(this).serialize();
$.ajax({
url: formSrc,
type: formMethod,
data: formData,
success: function(data){
//work with returned data from requested file
alert(data);
}
});
});
(taken from form submitting in jquery tab - but this ISN'T what I'm after)
and it "works" for what it's supposed to do - but it makes an AJAX call, and returns the action page in an alert... not what I want.
Not to mention it appears as though jQuery is stripping out the submit button variable...for instance I check for the existence of one or another submit button - HTML specs say if a submit button is clicked - IT gets passed as a value, but my firebug console shows the ajax form submit - with the 'POST' showing NO SIGN of the button variable (this is a side issue, which i think goes away if I can get the form to submit 'normally' into the tab)... any suggestions?
Hope that makes sense.