hope there is a simple solution - i'm sure i'm just overlooking something obvious.

my objective is to move individuals from an organization into committees, and to promote committee members to chairman positions. the form ultimately has three scrolling list select menus, and the buttons move members from one to another. i'm currently working on moving members out of the committee list back to the organization list. haven't started on the chairman assignment until i get this direction worked out.

print div({-class=>'taskcolumnleft'}, h3("Chair(s) of<br>$name committee"), start_form({-action=>"/memberarea/cmt/members/edit/"}), hidden(-name=>'requestID',-value=>$requestID), $currentchairlist, submit(-name=>'submit',-value=>'Remove Chairs')); end_form; print div({-class=>'taskcolumncenter'}, h3("Current Members of<br>$name committee"), start_form({-action=>"/memberarea/cmt/members/edit/"}), hidden(-name=>'requestID',-value=>$requestID), scrolling_list(-name=>"currmembers", -value=>$mbrArray, -size=>20, + labels=>$mbrHash, -multiple=>"true"), p( [ submit(-name=>'submit',-value=>'<<= Assign as Committee Chair' +), submit(-name=>'submit',-value=>'Remove Members =>>') ]), end_form); } print div({-class=>'taskcolumnright'}, h3("Members<br>(not on this committee)"), start_form({-action=>"/memberarea/cmt/members/edit/"}), hidden(-name=>'requestID',-value=>$requestID), scrolling_list(-name=>"addmember", -value=>$nocIDArray, -size=>20, + labels=>$nocNameHash, -multiple=>"true"), p(submit(-name=>'submit',-value=>'<<= Add Members')), end_form);

and my processing functions are as follows;

sub add_members { foreach (@addmembers) { my $sql = "INSERT INTO cmt_members (CmtID, MemberID)"; $sql .= "VALUES ($requestID, $_)"; my $sth = $dbh->prepare($sql) || die "Error preparing: $DBI::errstr"; $sth->execute || die "Error executing: $DBI::errstr"; } } sub remove_members { print p("we're in the remove members function"); foreach (@currmembers) { print p($_); my $sql = "DELETE FROM cmt_members WHERE MemberID = $_ and Cmt +ID = $requestID"; print p($sql); $sth = $dbh->prepare($sql) || die "Error preparing: $DBI::errstr"; $sth->execute || die "Error executing: $DBI::errstr"; $requestID = $requestID; } }

the "add_members" function works great - the "remove_members" doesn't

i have tested what post-data is being passed, and the @addmembers array works, but the @currmembers doesn't. i put in the line "print p("we're in the remove members function"), to test if it's being called, and it is, but @currmembers is empty.


In reply to CGI: multiple forms on page by jck

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.