Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.16

Request #1792 "helpInfo" to show next to a field to explain it's purpose
Submitted: 2004-07-05 11:39 UTC
From: scott at evolove dot net Assigned:
Status: No Feedback Package: HTML_QuickForm
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2004-07-05 11:39 UTC] scott at evolove dot net
Description: ------------ It's common for some fields to be confusing to a user (such as entering last 3 digits on the back of a CC), so I was required to implement "helpInfo" for my project - I think this should be part of the base QF package. Modifications: *element.php *var $_helpInfo added, with getters/setters *Renderer/Default.php *function renderElement modified *function _prepareTemplate modified (new signature) *custom template updated of course, to add a third colum to table output in default renderer Reproduce code: --------------- var $_elementTemplate = "\n\t<tr valign=\"middle\">\n\t\t<td align=\"left\" width=\"20%\" ><!-- BEGIN required --><span style=\"color: #ff0000\">*</span><!-- END required --><b>{label}</b></td>\n\t\t<td align=\"left\"><!-- BEGIN error --><span style=\"color: #ff0000\">{error}</span><br /><!-- END error -->\t{element}</td><td align=\"right\">{helpInfo}</td>\n\t</tr>"; var $_helpInfoTemplate = "<span style=\"border: 1px dotted #ccc; padding: 5px; width: 100px; background-color: #c09; color: white;\">{helpInfo}</span>"; --- // sm 05/07/2004 10:46AM test helpInfo $form->addElement('text', 'helpInfoTest', 'Help Info Test', array('size' => (FORM_FIELD_CC_SIZE + 3), 'maxlength' => (FORM_FIELD_CC_SIZE + 3))); $elem =& $form->getElement('helpInfoTest'); $elem->setHelpInfo('this is some here help info, bro'); Expected result: ---------------- a purplish box, aligned to the far right with helper information inside to explain what that form field is all about

Comments

 [2004-07-05 11:44 UTC] scott at evolove dot net
Note, that this solution works for groups as well (because HTML_QuickForm_group extends HTML_QuickForm_element). If you want my code to poke at my code, it is available here: http://www.badunka.com/files/QuickForm.zip I will notify you via this bug report if I update it (going to review it later today)
 [2004-07-05 13:11 UTC] avb
Have you tried looking at the enclosed example: docs/renderers/multiple-labels.php?
 [2004-09-15 10:29 UTC] avb
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.