Hello Monks!

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:

use HTML::FormFill; print HTML::FormFill->fill(html => $html, fields => $hashref, target => 'form_name', selects => {select1 => $AoH_ref, select2 => $Aoh_ref});
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.

Any ideas and suggestions are welcome.


Have you tried freelancing? Check out Scriptlance - I work there.

Edit: g0n - Moved from SoPW to Meditations


In reply to RFC: HTML::FormFill - but this one should prefill options in selects. by techcode

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.