Problems? Is your data what you think it is? | |
PerlMonks |
Re: HTML::FillInFormby bradcathey (Prior) |
on May 18, 2005 at 13:19 UTC ( [id://458191]=note: print w/replies, xml ) | Need Help?? |
Practical application of HTML::FillInForm, used in conjunction with my favorite templating module, HTML::Template, is not well documented anywhere that I could find. Here's my take. My biggest use of HTML::FillInForm will be for re-populating, selecting, or checking all the input types in my forms when returning the form for the user to correct a validation error, or when calling up a DB record to be edited. The associate function in H::T only "remembers" text-type input, so to avoid lots of convoluted javascript and Perl, I found the ideal tool in HTML::FillInForm. I did consider using CGI's very own popup_menu feature, but I am trying to keep my HTML completely separate from my Perl. Anyway, here are some methods I've discovered in experimenting with the two modules:
Note: a value passed in the hash ref to fdat trumps assigning a value to a <tmpl_var> of the same name . So, this will not work:
However, this will:
The above example can be used to populate a new form, e.g., when pulling up a DB record for editing. —Brad "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
In Section
Module Reviews
|
|