I'm wondering if I'm missing something simple here ..... I've got things working with a pretty cludgy looking work around: In the programming:
##CH likely a better way to do this if ($q->param('Color') eq 'Red') { $q->param('Red','checked') }; if ($q->param('Color') eq 'Blue') { $q->param('Blue','checked') };
And in the template:
<input type="radio" name="Color" value="Red" <!--TMPL_VAR NAME=Red -->"> <input type="radio" name="Color" value="Blue" <!--TMPL_VAR NAME=Blue -->">
But the above is really ugly, and I gotta believe there's a better approach (that I'm too dense to recognize)
That is exactly how I used to handle that situation as well. Until I started using HTML::FillInForm! Using HTML::Template to fill in form elements is a pain, and it clutters up the templates...
HTML::FillInForm will do all the hard work for you, without needing to worry if it's a checkbox, radio button, or just a plain input box you are dealing with. Just render your template, then run it through HTML::FillInForm before you send it out to the client.
The only caveat is that it needs to parse the entire HTML file to find the form elements and alter them, so it decreases the perfomance of your app slightly (not enough to worry me though).
Cheers,
Cees
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users