0

I've been wondering myself if there is a way to send a data after serialize.

Let me explain, I'm sending data this way:

var serialize = $('#foo').serialize();

$.post( "foo.php", serialize, function( arrRetorn, textStatus ){
    ...
}

I've tried something like this:

$.post( "foo.php", serialize, 
    {
        textarea: $('textarea').val()
    }, 
    function( arrRetorn, textStatus ){
    ...
}

Obviously it won't work, because the serialize also sent the data.

Is there a way to do this without have to pass all the input's name on post data?

Ramon Vasconcelos
  • 947
  • 3
  • 14
  • 31

1 Answers1

1

Have you tried something like this?

var serialize = $('#foo').serialize();
serialize.textarea = $('textarea').val();

$.post( "foo.php", serialize, function( arrRetorn, textStatus ){
   ...
}
T McKeown
  • 12,971
  • 1
  • 25
  • 32