in reply to HTML::Template and checking arbitrary radio buttons

Guess i should throw my two cents in ...

In less serious apps, i tend to bring in CGI.pm - but for a pure HTML::Template solution, i pass a param called 'checked' (most often this param is embedded to be used in a loop context) that is either undef or the value 'checked'. Then i can use something like:
<input type="radio" name="bar" value="bar1" <tmpl_var checked> />
I find this more elegant than using <tmpl_if>, but it is still a bit more work than i care to do on a regular basis (and the fact that it borks HTML editors doesn't bother me as i use gvim ). I really wish HTML::Template had methods to generate form elements like PHP's Smarty (but not too many - Smarty has lot's of methods that, IMHO, should not be there).

Update:
I also wish you could use square brackets for HTML::Template tags instead ...

<input type="radio" name="bar" value="bar1" [tmpl_var checked] />
Might be able to trick it with that 'Vanguard' compatibility mode ... but even if that worked, it's probably not safe.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)