I'm trying to create a form with a loop. I need to append a value to a
field name each time through the loop. For Instance:
while ($row = mysql_fetch_assoc($result)) {
$x=1;
echo tr;echo tdinput type='text' id='qty'
name='quantity_' size='2' value='$row[qty]' //td;
?
tdinput
On Sun, 2008-10-19 at 14:10 +0530, Sudheer wrote:
I'm trying to create a form with a loop. I need to append a value to a
field name each time through the loop. For Instance:
while ($row = mysql_fetch_assoc($result)) {
$x=1;
echo tr;echo tdinput type='text' id='qty'
the name value quantity needs the value of x appended to it. quantity_1,
quantity_2 etc.
I recommend using array notation instead of appending $x to the element
name. If you are using POST, when the form is submitted the values are
available in the $_POST['quantity'] array. You can use
I'm trying to create a form with a loop. I need to append a value to a field
name each time through the loop. For Instance:
while ($row = mysql_fetch_assoc($result)) {
$x=1;
echo tr; echo
tdinput type='text' id='qty' name='quantity_' size='2'
value='$row[qty]' //td;
echo
4 matches
Mail list logo