[HTML_Quickform] pass thru of attributes in date?
| From: | Geoff Hopson | Date: | Wed, 12 Mar 2003 15:49:43 +0000 |
| Subject: | [HTML_Quickform] pass thru of attributes in date? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-4180@lists.php.net to get a copy of this message | ||
Hi,
I have just started with PHP and Quickform, so please excuse my ignorance if this is stupid.
I want to be able to specify a stylesheet definition on each of the select boxes on date, and even though I create the date element thus:
$form->addElement('date', 'cny_reg_date', 'Date:', array('format'=>'d-F-Y'), "class=\"selbox\"");
My stylesheet does not get passed through. So I have edited date.php as follows (only included one switch statement - you get the drift)
switch ($sign) {
case "D" :
// Sunday is 0 like with 'w' in date()
$options = $this->_options[$this->language]["weekdays_short"];
$this->dateSelect[$sign] = &new HTML_QuickForm_select($selectName);
$this->dateSelect[$sign]->load($options, $selectedValue);
---> $this->dateSelect[$sign]->setAttributes($this->_attributes);
break;
I hope this is valid - I'm reluctant to create my own element and register that (mainly because I have no idea how to do that yet!).
Quickforms is allowing me to delete vast amounts of code I previously wrote to process forms - thanks!
Best wishes
Geoff
--
Geoff Hopson
Objectology Ltd.
http://www.objectology.co.uk/