Re: QuickForm and select
| From: | Gerard Bowe | Date: | Thu, 07 Jul 2005 15:50:20 +0000 |
| Subject: | Re: QuickForm and select | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19895@lists.php.net to get a copy of this message | ||
Gerard Bowe wrote:
john.f.kline@att.net wrote:solved (sitepoint) added $offices[] = "--Choose One--"; before populating array with values$selectArray['select'] = 'select'; while($row = $result->fetchRow()) {Sorry, should of said I'm using HTML_QuickForm and population the select with a database result array ($offices); $obj_form->addElement('select', 'office', 'Office: ', $offices); The first row of the array is automatically selected. What I would like to do is add an empty "row" so that the select tag shows --Choose One-- the html version is <select name="select"> <option selected>--Choose One-- <option value="1">Room 01 ............. </select> Sorry about the confusions (1st post !!) ger....$name=$row[0]; $value=$row[1]; $selectArray[$name] = $value; } -------------- Original message from Gerard Bowe <gerard.bowe@jrc.it>: --------------Is there a way to set the default to --Select--. I am > population the from a database, and the first row is always selected? thanks -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php