html_QuickForm / CreateFormStart()
Posted: Sat Aug 13, 2005 11:27 am
Wishy,
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
in
to
I needed some html_quickform generated variables to be present in the defining opening tag, so I added the $extra variable to mentioned file. This way it is now possible to use the following construction for making the opening tag:
The last parameter is what this is all about. It makes it possible to NOT use the quickform generated form tags, but use the CmsMS tags.
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.
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.