Modify POST vars before post, using jQuery

Posted by aidan on Stack Overflow See other posts from Stack Overflow or by aidan
Published on 2010-04-15T18:11:43Z Indexed on 2010/04/15 18:13 UTC
Read the original article Hit count: 749

Filed under:
|
|

I have a form, and a submit handler in jQuery.

When the user submits the form, I want to modify (add) some parameters to the POST request, before it is despatched from the client to the server.

i.e.

  1. User clicks 'submit'
  2. My jQuery submit hander begins execution...
  3. I create some new key/value pairs and add them to the POST payload

At the moment, it looks like my only options are to use $.post(), or $('form').append('

Thanks for any help.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about post