in reply to Re^2: Params in CGI
in thread Params in CGI

Seriously? Your going to use a broken interface because they like it better? The fact that you can't un-check them is huge and i would highly recommend you use check boxes, you can almost certainly make them do what you want. BTW I beleive that if you have more than one value for a given form element then it will return an array see CGI Docs for more info.


___________
Eric Hodges

Replies are listed 'Best First'.
Re^4: Params in CGI
by Anonymous Monk on Nov 20, 2008 at 17:09 UTC
    Hi Eric, Thanks, I think I wasn't clear with my question. I need to get what are the cells that has been clicked on. with the @names->$cgi->param() I get the params like checked(in case of checkbox) and type , plates and so on and not the cell name. For example, If I have clicked on A1 and D1 in the check box then I would like to have the screen to print "the boxes checked are A1, D1". Any idea?thanks.

      The check boxs all have the same name so they get returned as an array. The value of the check box would be the cell name. So @cells = $cgi->param("checkbox_name") would then return an array of cell names that are checked.


      ___________
      Eric Hodges
        Hi Eric, That was wonderfull. I could get the number of cells that were checked. But It should be exciting, if I could get the lables of the cells that were all checked.
        foreach my $cell (@rows){ split(/,/); print $cgi->td("$cell"); for(my $i= 1;$i<=12;$i++){ print $cgi->td($cgi->checkbox(-name=>'checked', -values=> +["ON"], -default=>'',-label=>"$cell$i")) ; } print $cgi->Tr(); }
        What I say is I like to have the labels, like A1, D1, E1, if they are checked.these are the labels for each cells. THe code you suggested gives 'on'(which is the default) when a checkbox is checked.Any options?
        thanks.