
Originally Posted by
ljm
Does anyone know of an alternative to this at all? I'm tempted to try and code my own classes, but since I'm new to this it's not going to be easy.
OOP forms are over kill...
I've done it from scratch and scratched the entire thing... it's too much overhead and complexity for what should be a simple thing...
Besides, I don't like abstracting presentation logic too much...
So with that in mind, I created this simple PHP include that generates most form HTML automatically... also included is a sweet little Javascript auto-validator that allows you to make fields required by simply setting a boolean.
Free to use... enjoy! 
(PS - remove the .txt extension on the .js file... WDF apparently doesn't allow JS uploads!)
EDIT:
Here's a sample usage of the include:
PHP Code:
<form action="<?=$_SERVER["PHP_SELF"]?>" method="post" onsubmit="return validate(this)">
<?=generateSelect("Data Type", "data_type_id", DataTypeManager::getAll(), "Select One", $element->getDataTypeId(), null, 410, true)?>
<?=generateInput("Name", "name", "text", $element->getName(), 30, 410, true)?>
<?=generateInput("Position", "position", "text", $element->getPosition(), 30, 410, false)?>
<?=generateInput("Length", "length", "text", $element->getLength(), 30, 410, false)?>
<?=generateInput(null, "submit_button", "submit", "Submit")?>
</form>