Friday, July 31, 2009

Can I pass an array as a parameter in a perl/cgi form?

If you add


local $" = "\n";


before your print statement, your array will appear in the hidden field with one item on each line. Then when you receive the submission you can do





my @array = split(/\n/, param('name'));

Can I pass an array as a parameter in a perl/cgi form?
Can we have some more details, please?


show form and script separately.





are you using cgi.pm?


==================


OK, do I understand you?


You want to pass an array into the value of a hidden field of a form?








The form is HTML code.


The hidden field can have only one value.


An array is more than one value!





loop through the array, writing one hidden field for each iteration.


No comments:

Post a Comment