DB_DataObject_FormBuilder & HTML_QuickForm questions with ArraySmarty renderer

From: Date: Wed, 24 Aug 2005 12:07:04 +0000
Subject: DB_DataObject_FormBuilder & HTML_QuickForm questions with ArraySmarty renderer
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-39550@lists.php.net to get a copy of this message
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? * 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. * 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. thanks, - Markus

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