[ZPT] Re: checking radio buttons

Wolfram Kraus kraus at hagen-partner.de
Thu Jun 23 09:05:39 EDT 2005


Kenneth Gonsalves wrote:
> hi,
> i have two radio buttons - 'yes' and 'no'. they have a name as 
> 'fixed'. Depending on the value of 'fixed' either 'yes' or 'no' 
> should be checked. I tried this:
> 
> <input type="radio" name="fixed" tal:condition="options/fixed" 
> checked/>Yes
>  <input type="radio" name="fixed"  tal:condition="not:options/fixed" 
> checked />Not Editable</p>
> 
> but doesnt work
> 
> any easy way of doing this?
>           
You have to set the "checked"-attribute of the radiobuttons:

<input type="radio" name="fixed"
   tal:attributes="checked python:test(options['fixed'], 'checked')" 
value="yes">YES<br>

<input type="radio" name="fixed"
   tal:attributes="checked python:test(not options['fixed'], 'checked')" 
value="no">Not Editable<br>

Untested!

HTH,
Wolfram



More information about the ZPT mailing list