I have an object that is inside of a form.
His value is assigned to an ajax call like this
var $$ = $(this);
if (typeof settings.data == 'string') {
data = settings.data + '&' + this.name + '=' + $$.val();
} else if (typeof settings.data == 'object') {
data = settings.data;
data[this.name] = $$.val();
}
I want to get the parent form of this element, and to loop through all inputs and add that too to the data to be used on an Ajax call.
I want the input name to be the key for the data array.
Probably something like:
var form = $$.parents('form:first');
and next thing to loop through the inputs and attach to data.
How to do that using jQuery?