I have read articles about FORM issues in PHP, and making
something that will be easy for:
- JS Validation
- PHP Validation
- FORM creation
- ----
- I want the previous values of the form to still be there
- I want error msgs
- I want form themes
- I want reusable components
- I want scrollbars!
- I want cookies (real cookies, and milk plz lol)
- I want it to be simple (KISS)
- I want it to be OO
<?
require "FormObjectTemplates.inc.php"
$formObj = new FormAll();
// The templates would have their own JavaScript validation
$formObj->addTextFromTemplate('name', txtName);
$formObj->addTextFromTemplate('howYouFeel', txtOneLineDescription);
$formObj->addCombo('cbBlah', 'Blah');
// This is PHP for submitting the form
if(isset($_POST['name']))
if($formObj->validatePOSTData())
$goodMessage = $formObj->getValidationMessage();
else
$error = $formObj->getValidationMessage();
// What we could do is instead of having validation problem MESSAGES
// We could send back objects so we can show an ERROR image right next
// To the form input that was invalid with a brief message of what went wrong.
?>
<script type="text/javascript">
<?
$formObj->printJavaScriptValidation();
?>
</script>
<?
$formObj->printHTMLForm();