Re: selected <option bla bla >
| From: | Wade | Date: | Wed, 25 Apr 2001 11:49:56 +0000 |
| Subject: | Re: selected <option bla bla > | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50279@lists.php.net to get a copy of this message | ||
I am sure my solution is not the most elegant, but this is what I did:
<?
switch($acc_state){
case "0":
$st0 = selected;
break;
case "AL":
$stAL = selected;
break;
.....
print "<SELECT size=1 tabindex=11 name=accstate>
<option value=\"0\" $st0 ></option>
<option value=\"AL\" $stAL >ALABAMA</option>
....
?>
""Hasbullah Pit (sebol)"" <sebol@ikhlas.com> wrote in message
news:3AE6A753.51156C3E@ikhlas.com...
> I have this one :-
>
> <select name="jenis_biasiswa">
> <option selected>Penuh</option>
> <option>Separuh</option>
> <option>Sendiri</option>
> </select>
> and a field of table which contained with
> 'Penuh' OR 'Separuh' OR 'Sendiri'
>
> I want to make it Ither one is 'selected' during a particular time.
> i'm thinking of having something like this:-
>
>
> <select name="jenis_biasiswa">
> <option <? function_that_determine_it_selected_or_not(Penuh)?>
> >Penuh</option>
> <option <? function_that_determine_it_selected_or_not(Separuh)?>
> >Separuh</option>
> <option <? function_that_determine_it_selected_or_not(Sendiri)?> >
> Sendiri</option>
> </select>
>
> Is that any prebuild/example funtion for that
> function_that_determine_it_selected_or_not(Sendiri) then print
> "Selected" ?
>
> thanks in advance
>
>
> --
> Hasbullah Bin Pit (sebol) http://ikhlas.com
>
> " Melihat keadaan sistem kehakiman sekarang ini,
> Saya tak hairan kalau saya disabitkan dengan kesalahan
> 'Menceraikan isteri di luar mahkamah' ketika saya masih bujang"
> - Hasbullah Pit -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>