Re: checkboxes and arrays

From: Date: Tue, 13 Feb 2001 12:24:30 +0000
Subject: Re: checkboxes and arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39397@lists.php.net to get a copy of this message
$num_inputs = 5; // if you want 5 sets of checkboxes and text inputs. for ( $i = 0; $i < $num_inputs; $i++ )
    {
    echo "<input type=checkbox name=checklist[$i]>Cb $i <input type=text
name=text[$i]>\n";
    }
yeah... that can work, I think it's a little less messy than what I've done... I did it like this: for each checkbox I did echo "<input type=checkbox name=checklist[] value=$id> Cb1 <input type=text name=asset_$id>"; then I check if isset(${"asset_".$id}) in my code... it's working fine... but it's kinda 'dirty'... I'll try yours... thanks! :) ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer

« previous php.general (#39397) next »