dru dru - 1 year ago 86
jQuery Question

Set hidden variable value equal to entire HTML of table

I'm trying to POST the entire HTML for a dynamic table to another page which will parse the HTML as an XLS file. I can't seem to get the onClick jQuery correct though, as the generated .XLS file just has contains one cell that reads :

[object Object]

onsubmit='$j("#datatodisplay").val( $j("#table1") ).html()'

is the name/id of the hidden variable,

is the table name.

Answer Source

Move your html() inside the val() function:

onsubmit='$j("#datatodisplay").val( $j("#table1").html())'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download