how to pass contents of an html table as form data on a POST?
html, javascript
Solution
Wrap your table in a form and put the data you want to post but not display to the user in hidden inputs
<form method="post" action="">
<!-- your table -->
<input type="hidden" name="name" value="your value"/>
<button type="submit">Post</button>
</form>
Problem
I have a list of groups in a `<select>` and a `<input type="button" value="Add Selected">` to add the selected group to a `<table>` of values. The list of groups that's been added is displayed in a `<table>`, rows are dynamically added by javascript on each click of the "Add Selected" button. Each row in the table has a "remove" link that removes the item from the table. Everything works fine, except now I want to POST the contents of the table to a URL, and I'm not sure how to do this. Should I add an hidden field for each row in the table? Or is there a better way to do this? Any suggestions are greatly appreciated! Rob