QFC validation

From: Date: Fri, 24 Oct 2003 21:35:35 +0000
Subject: QFC validation
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8566@lists.php.net to get a copy of this message
Hi! Just found out that the forms are only validated before the "process" Action. How can I get validation for more than one Button? How can I call it myself? I want something like the "tabbed.php" example but I want it to validate the Form no matter which button is pressed. And - how come in the Form it is: $this->getButtonName('submit') Whereas the Action that is called is 'process'? Usually - when I want to bind an Action to a Button I have to use the same name. Is 'process' the default Action which is called if the named Action (in this case 'submit') does not exist? It also seems that I do not manage to get a Button in a group (for use with renderers) connected with the process Action. Finally Renderers: Is it a good idea (unfortunately I forgot where I got this) to put the whole renderer in the display class: $renderer =& $page->defaultRenderer(); $tpl =& new HTML_Template_Sigma('Templates/'); $tpl->loadTemplateFile('file.html'); $renderer =& new HTML_QuickForm_Renderer_ITStatic($tpl); $renderer->setRequiredTemplate('{label}<font color="red" size="1">*</font>'); $renderer->setErrorTemplate('<font color="red">{error}</font><br />{html}'); $GLOBALS['_HTML_QuickForm_default_renderer'] = $renderer; $page->accept($renderer); $tpl->show(); Or is there a better way? There are just so many details that nobody tells you ... I would really appreciate a couple of bigger examples ... I feel quite stupid to have to ask everything here ... Thanks Daniel

« previous php.pear.general (#8566) next »