RE: Conditional default value of drop-down list

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

 



<select name=example>

	<option value='$id'>$name</option>

or:

	option value='$id'>$id - $option</option>

as you can see:

the value is what you give back to the $_POST, and wat is between
<option></option> really doesn't matter, it's just what you see... so you
can put anything between it...

is this what you mean?



-----Original Message-----
From: Jason End [mailto:bensnephew@yahoo.com]
Sent: maandag 7 april 2003 9:27
To: php-bb
Subject:  Conditional default value of drop-down list



Is it possible to create a drop-down list where the
initial value displayed depends on a variable. Say I
have a table called "categories" with columns "id" and
"descr". Currently I populate the list with a query:
$query = "SELECT descr from categories";

How could I make the default value of the list be
conditional on the categories id? So if the variable
categories id is "3", the initial value shown in that
drop down menu will be the description of the category
with id 3.
Does this make sense?

thanks, 

J


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux