View Full Version : NEWBIE: Pass checkboxes to PERL Routine

10-06-2009, 05:21 PM

I created a perl program, my first two steps runs very well but for my last page, I don't know how to manage and access a group of chekboxes with the same name. This is the portion of the second program that create the checkBox:

print qq(
<div class="reportMainHeader">Reschedule Hearings Report</div>
<div class="reportSubHeader">$Var{CourtTitle}-$Var{CourtName}</div>
<div class="reportSubHeader">Report Period: $Var{set_from} - $Var{set_to}</div><br>


my $table_header = qq(
<!-- <form enctype='multipart/form-data' method=post action='show_multidocs.pl?caseid=$Var{caseid}&pdf_header=$Var{pdf_header}'>
sform enctype='multipart/form-data' method=post' action='RescheduleHearingPRRpt.pl?arr_de_seq_nums=document.forms[0].arr_de_seq_nums
<script language=\"javascript\">\n
<!-- Begin
function checkAll(field) {for (i = 0; i < field.length; i++) field[i].checked = true}
function uncheckAll(field) {for (i = 0; i < field.length; i++) field[i].checked = false}
<center><table class="report" cellpadding=2 width='98%'>
<th white-space:nowrap'><SMALL>Select<br>
<a href='#' onClick=\"checkAll(document.forms[0].arr_de_seq_nums)\"'><font color="blue">all<font><small></a> /
<a href='#' onClick=\"uncheckAll(document.forms[0].arr_de_seq_nums)\"'><font color="blue">clear<font></SMALL></a>
<th width='5%'>Select</th>
<th width='25%'>Case</th>
<th width='30%'>Deadline/Hearing</th>
<th width='15%'>Date Due/Set</th>
<th width='30%'>Notes</th>

And this my perl routine that recieves the data:

sub XmlRescheduleHearing {

require '../support/routines.pl';
require '../support/MiscWidgits.pl';
require '../support/html-lib.pl';
require "../support/QueryRoutines.pl";
require "../support/qryDocumentRoutines.pl";
require '../support/DktActRpt.pl';
our %Var;

use Data::Dumper;
use strict;

# use warnings commented out by packaging script.
use XML::Writer;
use IO::File;

$Var{set_from} = date_valid($Var{set_from});
$Var{set_to} = date_valid($Var{set_to});

my $de_seq_nums = $Var{de_seq_nums};
if ($de_seq_nums) {
$de_seq_nums =~ s/[^\d,]//g;

my @arr_de_seq_nums;
my $arr_de_seq_nums_selected = getValue('arr_de_seq_nums');

if ($arr_de_seq_nums_selected) {
@arr_de_seq_nums = split(/\n/, $arr_de_seq_nums_selected);
if (scalar(@arr_de_seq_nums) > 0) {
my $de_seq_nums = @arr_de_seq_nums;
#numbers and commas only
$de_seq_nums =~ s/[^\d,]//g;
# else {
#show an error message if user didn't select any documents
#$Var{TextShownToTheUser} = "<h3>Error: You must select a document to continue.</h3>";
return 0;

10-06-2009, 07:20 PM
I assume your %Var hash holds the form submission values. Is that being assigned in html-lib.pl? Can you show us that code?