RE: Generating dynamically named tags

"Dan Horne" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Organization Redbone
Message-ID <001301c545eb$5772f570$6403a8c0@rdbxp01>
 > 
> > 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

Thanks for your reply. I'm not clear how it works. If I have a field called
"max_rows", then the parsed template will be

<input type="Text" name="max_rows"> value="5> err_max_rows

What should happen is that <tmpl_var err_max_rows> will be empty when the
template is displayed if there is no error, and will have the error message
if there is an error. This isn't done by me - it's done by
CGI:Application::Plugin::ValidateRM, DFV and HTML::FillInForm.

Thanks

Dan




-------------------------------------------------------
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.