Rod,

I have several input in a for that are T/F, Y/N, etc. and am getting the defaults from a database lookup before creating the form. Is there better (ie. more TT2 or perlish) way than doing this way?

Well, I don't know that it's particularly more Perl-ish or more TT2, but I always do it this way:


   <input type="radio" name="GETS_REPORT" value="F"
     [%- 'CHECKED' IF gets_report == 'F' %]/>No
   <input type="radio" name="GETS_REPORT" value="T"
     [%- 'CHECKED' IF gets_report == 'T' %]/>Yes

Basically the same as yours, but perhaps a bit more compact. Also, I always try to use lower case varnames to help distinguish from (and avoid potential conflicts with) TT2 keywords. (Actually, I would probably use a checkbox here rather than radio buttons, but perhaps that's just personal preference.)

HTH.


-- Buddy

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to