tags:

views:

305

answers:

2

Hi,

i can best describe this as follows:

I want this (entire table in 'editmode' and save button in every row)

<table>
    <tr>
        <td>Id</td>
        <td>Name</td>
        <td>Description</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td><input type="hidden" name="id" value="1" /></td>
        <td><input type="text" name="name" value="Name" /></td>
        <td><input type="text" name="description" value="Description" /></td>
        <td><input type="submit" value="Save" /></td>
    </tr>
    <tr>
        <td><input type="hidden" name="id" value="2" /></td>
        <td><input type="text" name="name" value="Name2" /></td>
        <td><input type="text" name="description" value="Description2" /></td>
        <td><input type="submit" value="Save" /></td>
    </tr>
    <!-- and more rows here ... -->
</table>

Now where do I put the <form> tags..?

+5  A: 

You can't. Your only option is to divide this into multiple tables and put the form tag outside of it. You could end up nesting your tables, but this is not recommended:

<table>
  <tr><td><form>
    <table><tr><td>id</td><td>name</td>...</tr></table>
  </form></td></tr>
</table>

I would remove the tables entirely and replace it with styled html elements like divs and spans.

stereointeractive.com
Agreed, don't use tables, use labels and form elements and CSS to align them. See http://www.websiteoptimization.com/speed/tweak/forms/
Dan Diplo
i was afraid that it wouldn't be possible... grrr. Thanks though
Ropstah
+2  A: 

Hi,

You just have to put the <form ... > tag before the <table> tag and the </form> at the end.

Hopte it helps.

Timothée Martin
this won't work as there are form elements with the same name for every tablerow...
Ropstah