serialization - $(this).serialize() -- How to add a value? -


currently have following:

$.ajax({     type: 'post',     url: this.action,     data: $(this).serialize(), }); 

this works fine, add value data, tried

$.ajax({     type: 'post',     url: this.action,     data: $(this).serialize() + '&=nonformvalue' + nonformvalue, }); 

but didn't post correctly. ideas on how can add item serialize string? global page variable isn't form specific.

instead of

 data: $(this).serialize() + '&=nonformvalue' + nonformvalue, 

you want

 data: $(this).serialize() + '&nonformvalue=' + nonformvalue, 

you should careful url-encode value of nonformvalue if might contain special characters.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -