Re: Generating dynamically named tags

Offer Kaye <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
On 4/20/05, Dan Horne wrote:
> Hi All
> 
> I'm writing a template for use with CGI:Application::Plugin::ValidateRM.
> C::A::P::VRM expects every field that requires validation to have a matching
> field  with an "err_" prefix (i.e  err_field_name).
> 
> My field names are dynamic, e.g.
> 
> <tmpl_loop name=application_parameters>
> <input type="Text" name="<tmpl_var name=field_name>" value="<tmpl_var
> name=field_value>
> </tmpl_loop>
> 
> but I can't figure out the best way to specify the error field. Obviously
> 
> <tmpl_var name=err_<tmpl_var name=parameter>>
> 
> doesn't work
> 
> Any ideas appreciated
> 

Generate it in the Perl script instead, in an H::T var named
"err_field_name". In the template just place:
<tmpl_var name=err_field_name>

HTH,
-- 
Offer Kaye


-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.