Re: DB_DataObject_FormBuilder & HTML_QuickForm questions with ArraySmarty renderer

From: Date: Wed, 24 Aug 2005 20:23:12 +0000
Subject: Re: DB_DataObject_FormBuilder & HTML_QuickForm questions with ArraySmarty renderer
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-39552@lists.php.net to get a copy of this message
On 8/24/05, Markus Fischer <markus@fischer.name> wrote: > Hi, > > we're using The DO formbuilder to generate forms and ran into a couple > of problems we weren't able to solve. Maybe someome has a suggestion > about this. > > * Generating HTML ids for input fields > Our requirement is to have labels associated with the input fields > (accessability/useability issue). This only works reliably cross-browser > with ids and the label for-Attribute. Example: <label > for="form-input-name">Name:</label> <input id="form-input-name" > name="name"> . We've seen that for a checkbox it is automatically > generated when we use the setText() method (why is it not using the > label?). How can this be activated for other type of input fields too? > This is a general problem with HTML_QuickForm. I suggest checking the list archives as people have asked this one before. You should be able to fix this with some clever scripting (loop through QF elements, add ids, add label tags around labels). > * Custom validation rule for fields which are "not null" > We've had all "required" fields for the form submission of type "not > null". However in this case we were not able to override the default > error message ("This field is required"). Calling addRule() simply > didn't change anything. Our solution was to change the database to be > "null" and then our custom rule was accepted. We mainly needed the > custom rules for translated error messages. See: http://opensource.21st.de/23.html#A17 > > * Rule validation on checkbox doens't work if the label is an empty string > We are using a checkbox which is required to be clicked (for > disclaimer). Initially we set the label of the checkbox to an empty > string and used the setText() method because it generated us the > <label>-Tags and for the layout it was more pleasant to have the text > shown after the checkbox. However, when the label is empty, the rule > validation doesn't work anymore. It seems it is never executed. > I'm not sure about this one. Try a simple QF-only example and see if the same is true. If it is, please submit a bug report with a simple example or try to track it down yourself. -- Justin Patrin

« previous php.pear.dev (#39552) next »