As a result of a recent node Populating options in html select I decided to start working on module that would beside filling form fields like existing modules do (such as HTML::FillInForm) also "fill" <select> </select> with possible options.
At this point it's pretty much just a concept and I'm "playing" around by sub classing HTML::Parser as I have no previous experience with any kind of parsing (excluding basic regexps).
At first I thought to subclass the HTML::FillInForm and add just an option to do what I want. But after looking at it's code, I realised that most work is done in one method (fill) so ... I'll just do it from scratch.
I was thinking to make it very simple to be used:
Of course, $AoH_ref's will most likely come from DB or something like that. Or to provide easy DBI integration, it could accept output of fetchall_arrayref() ? Fields $hashref could come from CGI's Vars method, DBI's fetchrow_hashref() ... or whatever. Html could be a string or reference to string ...etc.use HTML::FormFill; print HTML::FormFill->fill(html => $html, fields => $hashref, target => 'form_name', selects => {select1 => $AoH_ref, select2 => $Aoh_ref});
Any ideas and suggestions are welcome.
Edit: g0n - Moved from SoPW to Meditations
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RFC: HTML::FormFill - but this one should prefill options in selects.
by castaway (Parson) on Oct 11, 2005 at 11:25 UTC | |
|
Re: RFC: HTML::FormFill - but this one should prefill options in selects.
by fireartist (Chaplain) on Nov 04, 2005 at 12:24 UTC |