Need help on posting an array of text that are checkboxed
Posted: Tue Dec 04, 2007 11:40 am
feyd | Please use
update.php:[/syntax]
Using the above code, I get the correct values for $no, but for $qty, I get blank.
Any ideas what I'm doing wrong?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello. I'm trying to post an array of various rows all at once. One field has the "checkbox" type, the other has the "text" type. I want it to post all the values for both fields but only for the rows that are checked (could be more than 1). I can get the checkbox type to post, but not the text.
[syntax="html"]<form action=update.php method=post>
<input type=checkbox name=no[] value=$row[1]></input>
<input type=text name=qty[] value=$row[2]></input>
</form>
Code: Select all
if(isset($_POST['update']))
{
for ($i=0; $i<count($_POST['no']);$i++)
{
$no = $_POST['no'][$i];
$qty = $_POST['qty'][$i];
echo "no = $no<br>";
echo "qty = $qty<br>";
}
}Any ideas what I'm doing wrong?
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]