I have a form with multiple similar fields, which are created everytime the page is visited. The number or rows could vary depending on the rows in the mysql table.
Right now I have:
<?
while ($row=mysql_fetch_array($result, MYSQL_NUM)){
echo'<tr>
<td><input type="hidden" name="xID['.$row[0].']" value="'.$row[0].'"/>'.$row[0].'</td>
<td><input type="text" name="xName['.$row[0].']" size="25" maxlength="25" value="'.$row[1].'" id="input"/></div></td>
<td><input type="text" name="xValue['.$row[0].']" size="25" maxlength="25" value="'.$row[2].'" id="input"/></div></td>
<td>
<select name="xType['.$row[0].']" size="1" id="inputb">
<option value="1">Input Type . . .</option>
<option value="1">Plain Text (default)</option>
<option value="2">Date</option>
</select>
</td>
</tr>';
}
?>
Which outputs :
<tr>
<td><input type="hidden" name="xID[1]" value="1"/>1</td>
<td><input type="text" name="xName[1]" size="25" maxlength="25" value="nhl_season_deadline" id="input"/></div></td>
<td><input type="text" name="xValue[1]" size="25" maxlength="25" value="" id="input"/></div></td>
<td>
<select name="xType[1]" size="1" id="inputb">
<option value="1">Input Type . . .</option>
<option value="1">Plain Text (default)</option>
<option value="2">Date</option>
</select>
</td>
</tr>
A: Will this work correctly ?
B: Are there any potential problems ?
C: Will the output (name="xID[1]") be recognized as an array when I submit the form ?