If I do something like this
$.getJSON('/server/validate_field', { what:'validate', email_address:field.serialize() }, function(data)
then the query string ends up like this
validate_field?what=validate&email_address=email_address%3Dasdk%2540lal.com
Notice the duplicate. How can I fix this without having to manually create a key value pair for the form data?
field.serialize()returns a pre-formatted querystring, which is not what you want.You just want the field’s value:
field.val().jQuery will serialize that along with the rest of your object when sending the request.