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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-09-15 10:29 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!