Paul Makepeace wrote: > On 10/7/07, Josh Rosenbaum <[EMAIL PROTECTED]> wrote: >> Paul Makepeace wrote: >>> I'm wondering if there's been any discussion on augmenting TT with a >>> pythonic (and many others) IN keyword. Allowing something awesomely >>> compact and readable like, >>> >>> <input type="checkbox" name="[% name %]" value="[% val %]" >>> [% IF val IN c.req.param(name); 'checked="checked"'; END %] /> >>> >>> I'm at a loss how to achieve that without building up a hash. Any tips? >>> >>> P >> Ok, I'm assuming c.req.param(name) is returning a string with \0's in it. > > (Out of curiosity, why would you assume that? That doesn't strike me > as something one would typically have.) >
Because that's what the actual CGI value is for checked boxes with the same name. A string with the values separated by \0. Since you didn't explicitly tell us what was going on I assumed you were talking about a scalar since I thought you would've mentioned grep if you had a list. -- Josh _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
