Re: Option Value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, February 23, 2007 9:10 am, Dan Shirah wrote:
> On my form I have several drop down menus.  They all work and display
> the
> corrent values.  However, I would like the initial display of the form
> to
> show each dropdown as blank.
[snip]
> Any suggestions on how to make my initial display of the field blank
> without
> having to add a blank row to my table?

Just hard-code a blank OPTION in the HTML after the SELECT, but before
the PHP to dump out the other options:

<SELECT NAME="whatever">
  <OPTION VALUE="">-- Select Choice --</OPTION>
  <?php /* your posted code goes here */ ?>
</SELECT>

Presentation Purists will claim this is wrong, I suspect, since it
hard-codes the one special value for "nothing selected" but there it
is.

I personally have less trouble with this method than the other
half-dozen I tried over the years.

YMMV
IANAL
NAIAA

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux