[cgiapp] ValidateRM and dynamic content

Mark Fuller azfuller at gmail.com
Fri Feb 29 19:45:46 EST 2008


>  I am using HTML::Template and CGI::Application::Plugin::ValidateRM.
>  Page content is generated dynamically which works fine until a
>  validation error occurs.  Unfortunately <err_<TMPL_VAR field_name>> is
>  not valid H::T.

If your form fieldnames are dynamic I can think of a couple of options.

1. Use H::T's "filter" feature to preprocess the template and make
some dynamic changes to it.

2. Read the template yourself, dynamically add to it, and use
load_tmpl's ability to load from a scalar.

3. Dynamically create an included file before loading the template.

4. Don't use dynamic form fieldnames. If you need to distinguish
between how a form is used, set a hidden field value to essentially
categorize how this form is different than another form.

Maybe I'm missing something about why you're using dynamic field names.

Mark


More information about the cgiapp mailing list