7thwave
asked on
Code for multiple select boxes in perl
what is the section of code for obtaining the data from a multiple select box. I can get it to display the first value, but I need it to show all of the values selected. The script is in perl.
I'd recommend CGI.pm:
#!/usr/bin/perl
use CGI qw(:standard);
print header;
print start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
checkbox_group(-name=>'wor ds',
-values=>['eenie','meenie' ,'minie',' moe'],
-defaults=>['eenie','minie ']),
p,
submit,
end_form,
hr;
if( param() ){
print
"The keywords are: ",em(join(", ",param('words'))),
hr;
}
print a({href=>'http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html'},'Go to the documentation');
#!/usr/bin/perl
use CGI qw(:standard);
print header;
print start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
checkbox_group(-name=>'wor
-values=>['eenie','meenie'
-defaults=>['eenie','minie
p,
submit,
end_form,
hr;
if( param() ){
"The keywords are: ",em(join(", ",param('words'))),
hr;
}
print a({href=>'http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html'},'Go to the documentation');
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@params = split ("\0", $in{myvar});
If this is not the case then let me know what cgi library/module you are using.