Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: CGI array issues.

by greywolf (Priest)
on Oct 31, 2005 at 20:58 UTC ( #504417=note: print w/ replies, xml ) Need Help??


in reply to CGI array issues.

You just need a way to match the checkbox with the textarea. I would just run a counter when you create the form.

$output = qq~ <form><table> ~; $counter = 1; foreach $result (@$returned_results) { $checkname = 'include_' . $counter; $textname = 'summary_' . $counter; $urlname = 'url_' . $counter; $output .= qq~ <tr> <td><input type="checkbox" name="$checkname"></td> <td><textarea name="$textname"> yadda yadda </textarea></t +d> <td><input type="hidden" name="$urlname"></td> </tr> ~; $counter++; } $output .= qq~ </table></form> ~;
Now when you have a checked 'include_3' and 'include_87' you know that 'url_3' and 'summary_3' and 'url_87' and 'summary_87' need to go in the database.


mr greywolf


Comment on Re: CGI array issues.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2015-07-03 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls