Jump to content

[SOLVED] Accessing dynamically created HTML forms


amjohnno

Recommended Posts

There is probably an extremely simple answer to this but I can't seem to get my head around it.

 

Basically I have a form dynamically created by results from a database. As such it's going to be different ever time it's used. For each row in the database I want to have a drop-down list. So my HTML form looks like this:

 

<form id="formid" name="formname" method="POST" action="page.php">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Text 1</td>
<td>Text 2</td>
<td>
<select name="reference_to_unique_database_id">
  <option value="7" selected="selected">Seven</option>
  <option value="6">Six</option>
  <option value="5">Five</option>
  <option value="4">Four</option>
  <option value="3">Three</option>
  <option value="2">Two</option>
  <option value="1">One</option>
</select>
</td>
</tr>

<tr>
<td>Text 1</td>
<td>Text 2</td>
<td>
<select name="reference_to_unique_database_id">
  <option value="7" selected="selected">Seven</option>
  <option value="6">Six</option>
  <option value="5">Five</option>
  <option value="4">Four</option>
  <option value="3">Three</option>
  <option value="2">Two</option>
  <option value="1">One</option>
</select>
</td>
</tr>

[etc...]

<tr>
<td colspan="3"><input type="submit" value="Update" /></td>
</tr>
</table>
</form>

 

My question is, once I've submitted the form how would I gather the information using php given that each time the form is submitted the names of the form elements are going to be different?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.