Hi Monks!

I am working on this program that will print to the browser a grid of data rows from this database table, and I will have to select one or more rows and send the selected row(s) to this other program to process the changes. I am having a hard time on how after clicking on the checkbox(s) submit the corresponded row or rows of data to my other Perl program.
I am including a sample table with a data grid of what I am trying to accomplished with this (don't consider the JS to select all to work), I hope someone has done such thing that can show me how I can get this problem done.
Here is the code:

#!/usr/bin/perl use strict; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); my $q = new CGI; print header(); print <<HTML; <div style="width: 750px;"><form name="form" method="get" action="get_ +data_rows.pl"> <table class="GridView" id="GridView1" style="border-collapse: col +lapse;" rules="all" border="1" cellspacing="0"> <tbody> <tr class="Pink"> <th scope="col" align="left">Select All <span title="Click here to select/deselect all + rows"> <input id="" name="ctl0" type="checkbox"></sp +an> </th><th scope="col">Company Name</th><th scope="c +ol">City</th><th scope="col">Country</th> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl1" type="checkbox"> </td><td>Alfreds Futterkiste</td><td>Berlin</td><t +d>Germany</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl2" type="checkbox"> </td><td>Ana Trujillo Emparedados y helados</td><t +d>México D.F.</td><td>Mexico</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl3" type="checkbox"> </td><td>Antonio Moreno Taquería</td><td>México D. +F.</td><td>Mexico</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl4" type="checkbox"> </td><td>Around the Horn</td><td>London</td><td>UK +</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl5" type="checkbox"> </td><td>Berglunds snabbköp</td><td>Luleå</td><td> +Sweden</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl6" type="checkbox"> </td><td>Blauer See Delikatessen</td><td>Mannheim< +/td><td>Germany</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl7" type="checkbox"> </td><td>Blondesddsl père et fils</td><td>Strasbou +rg</td><td>France</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl8" type="checkbox"> </td><td>Bólido Comidas preparadas</td><td>Madrid< +/td><td>Spain</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ctl9" type="checkbox"> </td><td>Bon app'</td><td>Marseille</td><td>France +</td> </tr><tr title="Click to toggle the selection of this row"> <td> <input id="" name="ct20" type="checkbox"> </td><td>Bottom-Dollar Markets</td><td>Tsawassen</ +td><td>Canada</td> </tr> </tbody></table> <input name="ct" value="Submit your Changes" onclick="return C +onfirm();" type="submit"> <span id="Status"></span></form> </div> HTML ;


Thanks for the Help!!!

In reply to Select data rows from a grid with Perl by Anonymous Monk

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.