Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: complex checkbox group

by Anonymous Monk
on Jul 21, 2004 at 00:38 UTC ( #376127=note: print w/ replies, xml ) Need Help??

in reply to Re: complex checkbox group
in thread complex checkbox group

really I'm asking more about the checkboxes and how to break them into sub-check box groups ;-)

Comment on Re^2: complex checkbox group
Replies are listed 'Best First'.
Re^3: complex checkbox group
by crabbdean (Pilgrim) on Jul 21, 2004 at 04:37 UTC
    Below is code I use for checkboxgroups. The code offered by hbo can still be used as it provides the necessary array of @weekday which you can use in my code below. Additionally if you wanted to just select a specific day set @selected to [$weekday[$num]] at the beginning and remove the where $num would represent the day of the week. I hope this code serves as a guide to help you to your own solution, unfortunately I'm at work at the moment and can't dedicate the time to writing the exact code for you. This should be pretty close I think without testing.
    ## whatever @selected is set to at the beginning ## is how your checkboxgroup will appear on loading ## Choose between one of these two lines #my @selected = @weekday; ##--> to select all #my @selected = ($weekday[#a number]); ##--> to select one foreach my $selected_day (@weekday) { my $checkbuttongroup = $rF->CheckbuttonGroup ( -list => [ $selected_day ], -orientation => 'vertical', -variable => \@selected, -font => 'bold', )->pack(-anchor => 'nw', -side => 'top', ); }
    Update: I should add that when you run the program whatever boxes you check is what @selected will contain. Eg. Monday, Wednesday etc. You can check it by using a "print $_ for @selected" on a button callback.

    Opps Update: Sorry this is how to do it in TK. I didn't see that you wanted it for CGI. If you ever get around to TK this is how its done. :-) <grinning>

    The Funkster of Mirth
    Programming these days takes more than a lone avenger with a compiler. - sam
    RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://376127]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-11-30 22:23 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (788 votes), past polls