QF: Group templates, why does {error} shows up
| From: | Mark Steudel | Date: | Thu, 16 Mar 2006 22:50:25 +0000 |
| Subject: | QF: Group templates, why does {error} shows up | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23314@lists.php.net to get a copy of this message | ||
I'm messing around with the templates/default renderers with quick forms and
have the following:
$form = new HTML_QuickForm( 'shoppingCart' );
$gElement = "\n\t\t<td><!-- BEGIN error --><span style=\"color:
#ff0000\">{error}</span><br /><!-- END error
-->{element}</td>\n\t";
$renderer =& $form->defaultRenderer();
// create shopping cart item
$item[] = HTML_QuickForm::createElement( 'checkbox', 'remove', null );
$item[] = HTML_QuickForm::createElement( 'static', 'description', null,
'Text' );
$item[] = HTML_QuickForm::createElement( 'text', 'quantity', null, array(
'size' => '4' ) );
$item[] = HTML_QuickForm::createElement( 'select', 'deliveryoptions', null,
$delivery);
$form->addGroup( $item, 'item', null, '');
// $form->addGroupRule('item', array( $objData->id => array(
'quantity' =>
array( array('Numbers only', 'numeric')))));
$renderer->setGroupElementTemplate( $gElement, 'item' );
Im not really sure how QuickForm knows to show the error or not, or what Im
leaving out in my group element template that hides the error place holder
when there isn't any errors.
TIA, Mark