in reply to button in a table?

And as a combination of hiseldl's response and Improv's reponse...
You could follow hiseldl's loop to give your submit buttons different names and use param() to find out which one was clicked.

Replies are listed 'Best First'.
Re: Re: button in a table?
by Improv (Pilgrim) on Apr 11, 2003 at 17:31 UTC
    Here's a code snippet:
    my $cq = new CGI; my $targ = $cq->param('target'); if(defined($targ)) { # User gave us a target name. Do the rename and tell the use +r all's good ... }
    At the top of the program, I'm doing "use CGI", of course. And, of course, this is all in a .pl that's in my cgi-bin directory :)
      Great, That works, but take me one more step how do I get the rownum reference into the code in the script_to_read_rownum.cgi? http://localhost/script_to_read_rownum.cgi?rownum=
        I don't understand. There are the things you need to do.
        1. In your for loop, build form buttons that submit the appropriate rowid to your target URL
        2. In the CGI which recieves the form submission, use use the CGI module, get a CGI object $foo, and call $foo->param("fieldname"). You get whatever was passed as the value of that field, or undef if nothing was passed
        3. Act accordingly
        I'd be happy to help further, if you tell me exactly which step you'd like help on. Cya