Hi,
I need to obtain postdata from a form and send it
via ajax .
The code is given below :
var $fields = $('#myform :input').serializeArray();
var values = {}
jQuery.each($fields, function(i, field)
{
values[field.name] = field.value
});
myJson = JSON.stringify(values);
Now, instead of values[field.name]
I want id of the element to be
key of postadata to be sent . I have tried values[$(this).attr('id')] = field.value
but,
It is not working . Any help will be valuable