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

Request #3575 date single emptyoptions
Submitted: 2005-02-24 14:00 UTC
From: garak Assigned:
Status: Closed Package: HTML_QuickForm
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-02-24 14:00 UTC] garak
Description: ------------ addEmptyOption is too limited. I need 3 different options for year, month and day. I mean, something to display "choose year" in the top of year select, "choose month" in the top of month select and so on.

Comments

 [2005-03-18 14:08 UTC] garak
Well, since nobody replied to me, I did it on my own. Here's my diff: 352,353c352,357 < // Preserve the keys < $options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options; --- > if (is_array($this->_options['emptyOptionValue']) && isset($this->_options['emptyOptionValue'][$sign])) { > $options = array($this->_options['emptyOptionValue'][$sign] => $this->_options['emptyOptionText'][$sign]) + $options; > } else { > // Preserve the keys > $options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options; > } It just needs to modify the options passed to addElement, passing emptyOptionValue and emptyOptionText as array (with keys corresponding to signs used in format)
 [2005-06-28 16:23 UTC] avb
Different 'emptyOptionText' values implemented in CVS. Different 'emptyOptionValue' values were not implemented due to dubious usefulness of this feature.