Greetings,

A dear friend of mine has recruited me to assist her with a project for the community college she works for. The end result of the project is a several page web application that tests a student's abilities to perform basic tasks on the Internet (filling out forms, following links, e-mailing, etc.). I pretty much have a handle on the project, but one piece of it is still managing to elude me.

A sample of the form that is giving me a headache can be seen at http://www.cromedome.net/test01.html. The "time matrix" is to be filled out by the student - submitting of the form takes adds that information to our database and presents the student with the next part of the application. The problem is that I'm trying to come up with the most efficient way of generating and extracting information from that form (the form must remain in that general format). Here's what I've come up with, but none of these options seem too appealing at present:

1) Create a checkbox for each cell of the table. Have one parameter for each checkbox on the form. Manually check each one of these checkboxes and update the database with the appropriate information. This is obviously the method I like least.

2) Create a checkbox for each cell of the table. Iterate through the list of all parameters to our script, and extract information for only those parameters that are checkboxes. Update the database with the appropriate information. Seems much more manageable than #1, but there's still the tedium of creating each individual checkbox on the form.

3) Use Perl and CGI.pm to programmatically generate groups of checkboxes, one group for each day. This seems a slick way of doing it, but how can I produce a checkbox group where each checkbox is in it's own table cell? The only way I know how to do something similar would be to create one checkbox group for each timeslot, then use the linebreak property to print the checkbox for each day on it's own line. But that seems cheesy.

In all the Perl and web programming I've done, I've never really had to work with this complex of a form before. I guess what I'm looking for is any insight that you might have for me. What's the best way to construct this form? What's the best way to extract the parameters that submitting the form will produce? I'm not the person who will ultimately be supporting this, so simpler is definitely better.

Thanks in advance,
MrCromeDome


In reply to Converting large numbers of checkboxes to small number of params by MrCromeDome

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.