Tom Tom - 1 year ago 140
jQuery Question

Serialize table tr data?

I'm serializing my form using :

formVals = $('#formID').serialize();

But I also have a table that I'd like to serialize and add it to
Can that be done? I've tried :

formVals = $(this).text().serialize();

But that results in

Uncaught TypeError: $(...).text(...).serialize is not a function

What I want to do is take the text from each
and add it as a new entry to
along with the exiting date. Is there way to do this?



A row looks like this :

<tr id="12354-515-asd">

The expected values to be added to formVals is:

Answer Source

You need to concatenate each parameter to formVals.

formVals = $("#formID").serialize();
    formVals += '&' + + '=' + encodeURIComponent($(this).text());
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download