Alright, I created a class that allows me to add all of my fields into one call to the class, but when it returns it only comes back with one field instead of say 3 or 4, how do i get it to return all of them. Heres the code:
function createForm( $action = "", $method = "POST", $typeArray = array( array() ) )
{
if( !is_array( $typeArray ) )
{
print "[error] - Your fields must be in a 2D array.<br>\n";
return FALSE;
}
$this->setFieldArgs( $typeArray );
$this->formVar .= $this->startForm( $this->setAction( $action ), $this->setMethod( $method ) );
/*while( list( $t, $tArray ) = each( $typeArray ) )
{
print "Type Value: $t<br>\n";
while( list( $name, $value ) = each( $tArray ) )
{
$this->formVar .= "$name=\"$value\" <br>\n";
}
}*/
while( list( $name, $value ) = each( $this->myFieldArgs ) )
{
if( eregi( 'input', $name ) )
{
$this->formVar .= $this->inputFields( $value );
}
elseif( eregi( 'select', $name ) )
{
return $this->selectFields( $value );
}
else { print "[error] - Invalid set of argument.<br>\n"; return FALSE; }
}
$this->formVar .= $this->closeForm();
return $this->formVar;
}
Then i call it as this:
$form = new htmlForm();
print $form->createForm( "$PHP_SELF", "GET", array( 'input'=>array( 'type'=>"text",'name'=>"queryTable",'size'=>"30",'maxlength'=>"100" ),
'input'=>array( 'type'=>"text",'name'=>"updateTable",'size'=>"30",'maxlength'=>"100" ),
'input'=>array( 'type'=>"text",'name'=>"insertTable",'size'=>"30",'maxlength'=>"100" ),
'input'=>array( 'type'=>"text",'name'=>"deleteTable",'size'=>"30",'maxlength'=>"100" ) )
);
any help would be very much appreciated.