About the Form Attribute

Use the form attribute to attach input fields to a specific form. This is especially useful when working with tabular data, where different cells can have common or individual form actions, for example:

<form id="export_form" action="" method="post">
  <button type="submit" 
   name="action" value="export">Export</button>
</form>

<table>
  <tr>
    <td>
      <input name="id" type="checkbox" value="1"
       form="export_form" />
    </td>
    <td>Django Blog Tutorial</td>
    <td>
      <form action="" method="post">
        <input type="hidden" name="id" value="1" />
        <button type="submit" 
         name="action" value="delete">Delete</button>
      </form>
    </td>
  </tr>
  <tr>
    <td>
      <input name="id" type="checkbox" value="2"
       form="export_form" />
    </td>
    <td>Django Chat Tutorial</td>
    <td>
      <form action="" method="post">
        <input type="hidden" name="id" value="2" />
        <button type="submit" 
         name="action" value="delete">Delete</button>
      </form>
    </td>
  </tr>
</table>

Tips and Tricks Development HTML5