Re: DB: do I need to check if (DB::isError($res)) if I setErrorHandling() to callback function?

From: Date: Wed, 24 Aug 2005 12:43:23 +0000
Subject: Re: DB: do I need to check if (DB::isError($res)) if I setErrorHandling() to callback function?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20575@lists.php.net to get a copy of this message
I could be talking complete garbage here, but I'll try to help. If the form is of a reasonable size, I would set up an array of single elements you want to add a <label> for, then do a foreach on that array passing each element name to QuickForms 'setElementTemplate' function. Then do the same for element groups that cannot have a <label>. Try this:
$LabelStyle = '<label class="formT">{label}<!-- BEGIN required --><span>*</span><!-- END required --></label>
        <!-- BEGIN error --><span
style=>{error}</span><br/><!-- END error -->{element}<br/>'; $PlainStyle = '{label}<!-- BEGIN required --><span>*</span><!-- END required -->
        <!-- BEGIN error --><span
style=>{error}</span><br/><!-- END error -->{element}<br/>'; $SingleElements = array('firstname','lastname','email'); $GroupElements = array('radios1','advcheckboxes','date'); foreach ($SingleElements as $ElementName) { $form->setElementTemplate($LabelStyle,$ElementName); } foreach ($GroupElements as $ElementName) { $form->setElementTemplate($PlainStyle,$ElementName); }
I haven't tested this, but I think it will work :-) Cheers; Poncho On 24 Aug 2005, at 13:09, l Burnerheimerton wrote:
Poncho I read your post about not wrapping around certain elements. How do you determine which elements will be wrapped? Thanks ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs --PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


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