views:

261

answers:

2

im doing following

var data = $(form).serializeArray();
// now i want to  add another value on this data
data.username = 'this is username';

i want to know how can i add another value after doing serializeArray(), i tried all the things i know, but nothing is getting it to work. any ideas pls.

A: 

I think it's just

data['username'] = 'this is a username';
Josh Pearce
yep tried it, didnt work.
Basit
+2  A: 

try

data[data.length] = { name: "username", value: "The Username" };
Lobstrosity