Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-12-10 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?