Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Location
    Puerto Rico
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    NEWBIE: Pass checkboxes to PERL Routine

    Hi,

    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}
    </script>
    <center><table class="report" cellpadding=2 width='98%'>
    <tr>
    <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>
    </tr>
    <tr>
    <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>
    </tr>\n
    );



    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:umper;
    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;
    }

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,871
    Thanks
    2
    Thanked 164 Times in 159 Posts
    I assume your %Var hash holds the form submission values. Is that being assigned in html-lib.pl? Can you show us that code?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •