I use pear's HTML/QuickForm.php and HTML/QuickForm/Renderer/ArraySmarty.php to make my forms for the backend of CmsMS. It has validation (server AND client side!), own validation rules, proper template handling and much much more.
In order for the whole thing to work smoothly within CmsMS I changed the definition of
Code: Select all
function CreateFormStart($id, $action='default', $returnid='', $method='post', $enctype='', $inline=false)
Code: Select all
lib/classes/class.module.inc.php
Code: Select all
function CreateFormStart($id, $action='default', $returnid='', $method='post', $enctype='', $inline=false, $extra=null)
Code: Select all
$this->smarty->assign('formStart', '<div class="adminform">' . $this->CreateFormStart($id, 'edittrip', $returnid, 'post', '', '', ' onsubmit="return validate_edittrip(this);"'));
The parameter can be either an array or a string, the logic is smart enought to make the right decission.
Could the source code for lib/classes/class.module.inc.php in the CmsMS sourcetree be extended by the code above, so my code won't break next time I do an update

I am working on a solution to 'read' the extra attributes that Quickform will generate, so the whole thing will be really dynamic.