Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Don't ask to ask, just ask
 
PerlMonks  

Re: checkbox name processing

by Anonymous Monk
on Aug 09, 2000 at 08:14 UTC ( [id://26980]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to checkbox name processing

If I understand the problem correctly what you are trying
to do is when the submit button is hit is to find the filenames
of the files that have been checked
In the following piece of code, when the submit button is hit
the array @files will contain the names of the files checked and the
string 'submit'
#!/usr/bin/perl -w use CGI; $page = new CGI; print $page->header(); print $page->start_html(); if ($page->param('submit')) { @files = grep {defined CGI::param($_) or CGI::param($_) ne ''} CGI +::param(); print @files; exit; } print $page->startform(); @latest = qw(one two three); foreach $fname(@latest) { print qq($fname <input type='checkbox' name='$fname' value='$fname +'>); print qq(<br>\n); } print qq(<input type='submit' name='submit' value='Submit'); print $page->endform(); print $page->end_html();
Hope this helps

Replies are listed 'Best First'.
RE: Re: checkbox name processing
by vrempire (Sexton) on Aug 09, 2000 at 08:58 UTC
    Thanks for your reply,I really appreciate it.So,for the array @files,is the array also being send to the next cgi file to process when the submit button is clicked,or is the array @files is still inside the current cgi file? I prefer that the @files can be send also to the next cgi file,so I can process it inside the new one. Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://26980]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.