perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject RE: option selected problem
Date Tue, 20 Dec 2005 20:36:08 GMT
Hi,

>         
> i've a little wired problem with a pice of code.
>         
> <select name="firma">
>     <option> ------ </option>
>     [$ foreach $firma (@firmenid) $]
>         [$ if $fdat{firma} eq $firma $]
>             <option selected>[+ $firma +]</option>
>         [$ else $]
>             <option>[+ $firma +]</option>
>         [$ endif $]
>     [$ endforeach $]
> </select>
>         

You should rewrite as

 <select name="firma">
     <option> ------ </option>
     [$ foreach $firma (@firmenid) $]
           <option value="[+ $firma +]">[+ $firma +]</option>
     [$ endforeach $]
 </select>

If you have the value attribute, Embperl will take care about selecting the
correct option

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message