Hi George!

george wrote:
> I am trying to build a form which can be geberated dynamically
> by the user selecting the number of fields up to a max of 10.
> just now i am using
> if ($fields ==1){
> echo "<input type=text name=test>";
> }
>  elseif ($fields ==2){
> echo "<input type=text name=test>";
> echo "<input type=text name=test>";

You could use a 'for' structure to do that...like:
for ($i=0; $i < $fields; $i++)
{
  echo "<input type=text name=test[" . $i . "]>";
}

  The 'echo' line is different from yours so u can get each text value
after the POST action.

See you,
-- 
Lucas Persona

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to