I've actually implemented something like this before for static forms html forms.

The solution I came up with was an object that was a subclass of HTML::Parser. It was passed a CGI which held all of the info about what had been selected (I was keeping this info around in a database, so that I could pull up any form at anytime and repopulate it with its last info for that user), and then as I parsed through the html, when I hit an input field (or select fields), I would start filling them in with the appropriate info.

All of this worked off of the field names, so I could actually pull up a different form with the same field names, and populate it.

I Suppose that wasn't much of a technical answer, but maybe it will give you some ideas on how you might want to implement something yourself.

Let me know if you want more info on how I did it.


cephas

In reply to Re: Retaining Input by cephas
in thread Retaining Input by brosenb

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.