Aranya Ghatak wrote:
> How do I select the passed value of a field in an OPTION radiobutton 
> construct in HTML.  I am trying to use a database edit screen, where one 
> field should be represented by drop down or radiobuttons.  In other 
> words, the correct option should be "SELECTED" based on the previous 
> value passed.  See simplified code below.

In your example you should try:
      <OPTION VALUE="Item Three" <tmpl_if 
option>SELECTED</tmpl_if>>Three  <!-- need a SELECTED after OPTION

I personally prefer:

my @drop = ( { value => '1', label => 'option 1', select => '1'},
  { value => '2', label => 'option 2' },
  {value => '3', label => 'option 3'};

$template->param ( drop => @drop );

and in the template

<select name=drop>
<tmpl_loop drop><option value="<tmpl_var value>" <selected>><tmpl_var label>
</tmpl_loop></select>

But it a matter of choice and style how you prefer to do it...

(( 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