First of all, this piece of code
function TextArea( $input, $name, $height, $width )
{
if( isset( $input ) )
{
switch ( $input )
{
case NULL:
echo "<textarea name=\"$name\" rows=\"$height\" cols=\"$width\" id=\"$this->errorstyle\">$input</textarea>";
break;
default:
echo "<textarea name=\"$name\" rows=\"$height\" cols=\"$width\" id=\"$this->style\">$input</textarea>";
break;
}
}
else
{
echo "<textarea name=\"$name\" rows=\"$height\" cols=\"$width\" id=\"$this->style\"></textarea>";
}
}
Can be written much shorter, like
function TextArea( $input, $name, $height, $width ) {
echo "<textarea name=\"$name\" rows=\"$height\" cols=\"$width\" id=\"".($input == NULL?$this->errorstyle:$this->style)."\"></textarea>";
}
Saving you a lot of time.
If you want to create a really dynamic formgenerator I suggest you read some more on OOP practices, especially on classes and overloading.
I think the best thing you could do is create a base formmaker class and create multiple formelement classes.
Good luck,
Marvin