Kapoor, Nishikant X wrote:
>>Would you generate the entire drop-down into an <tmpl_var 
>>XXX>-variable 
>>or what?
> 
> I was thinking in terms of having the drop-down done in .html and set its values in 
>.pl like,
> 
> test.html:
> <select>
>   <option value="Mr" <tmpl_if Mr>selected</tmpl_if>>Mr</option>
>   <option value="Ms" <tmpl_if Ms>selected</tmpl_if>>Ms</option>
 >   <option value="Mrs" <tmpl_if Mrs>selected</tmpl_if>>Mrs</option>
 >   <option value="Dr" <tmpl_if Dr>selected</tmpl_if>>Dr</option>
 >   <option value="Prof" <tmpl_if Prof>selected</tmpl_if>>Prof</option>
> </select>
> 
> test.pl:
> $template->param($user->{titleName} => 1);
> 
> User selects his/her title from a drop-down when creating a new account. 
 > This is then entered into a db and, retrived into $user when setting it
 > back into .html. Coders do not have to worry about what title to use
> for a user. Html page designers are the only ones who keep 
 > working on setting these titles.

I would never put the actual values in the template. In my world they 
belong either in a database or in some configuration file - you never 
know when they change.

I usually prefer the "
<option value="<tmpl_var value>" >><selected>><tmpl_var label>

"-approach becuase our designers use a lot of CSS'ing to style the 
design. Another reason is the fact that the designers may change the 
drop-down to radio-buttons if they wish. I really don't care from a 
"coding point-of-view" - the only assumption I do (usually) is that only 
one value is set and only one value is posted.

(( Flemming ))
-- 
Flemming Mahler Larsen, Media & Portal Technology @ TDC Internet
http://card.netfactory.dk/ , +45 3552 6452


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to