in reply to Params in CGI

In my case I should be able to check more than one radio button. So I have got different names for each button.
Methinks you shouldn't be using radio buttons, but check boxes. Radio buttons not only have the disadvantage you mentioned, but once they're on, the user can't turn them off again. Ouch.

Make them checkboxes and you can give them the same name; use row name and column letter for the value. And your problem is solved.

Replies are listed 'Best First'.
Re^2: Params in CGI
by Anonymous Monk on Nov 20, 2008 at 14:33 UTC
    Also, How could I get the list of check boxes that has been checked in this? (If I manage the people to like checkboxes??)
      my @checked = grep { param($_) eq 'ON' } param();
        That assumes the value(s) are "ON", but they could be anything (and other variables could have same value).
Re^2: Params in CGI
by Anonymous Monk on Nov 20, 2008 at 14:09 UTC
    Thats true, But I have to use the radio buttons :( the lab people here do like radio buttons more than the checkboxes :(

      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
        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.