Re: [htmltmpl] Generating dynamically named tags
Brought to you by:
samtregar
From: Offer K. <off...@gm...> - 2005-04-20 11:30:49
|
On 4/20/05, Dan Horne wrote: > Hi All >=20 > 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 match= ing > field with an "err_" prefix (i.e err_field_name). >=20 > My field names are dynamic, e.g. >=20 > <tmpl_loop name=3Dapplication_parameters> > <input type=3D"Text" name=3D"<tmpl_var name=3Dfield_name>" value=3D"<tmpl= _var > name=3Dfield_value> > </tmpl_loop> >=20 > but I can't figure out the best way to specify the error field. Obviously >=20 > <tmpl_var name=3Derr_<tmpl_var name=3Dparameter>> >=20 > doesn't work >=20 > Any ideas appreciated >=20 Generate it in the Perl script instead, in an H::T var named "err_field_name". In the template just place: <tmpl_var name=3Derr_field_name> HTH, --=20 Offer Kaye |