I'd like to be able to update multiple database rows on one web page.
If I give the fields the same name, then Apache::Request kindly returns the data to me as an array, so I can do something like this:
my @field1 = $r->param('field1');
my @field2 = $r->param('field2);
my @field3 = $r->param('field3');
Although this isn't pretty, I can then iterate over the first array, and grab the value out of the other arrays with the same index number.
The problem is, when I have a field that's a checkbox. If the box isn't checked, then I get no value in the array, and the index numbers don't line up.
I suspect there's a better way of doing this, but if not, is there a way around the problem with checkboxes?
Thanks.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.