The Javascript called when they onclick is<form action="post" name="RunForm"> <input id="env" type="hidden" name="env" value="PROD"/> <select id="runs" name="runs" multiple=""> <option>2010-08-17 ----- 039733</option> <option>2010-08-17 ----- 039753</option> </select> <p> <input type="button" onclick="UntarFiles(env,runs)" value="Combine Fil +es"/> <input type="reset" value="Cancel" name="Cancel"/> </p> </form>
and in the called perl cgi program, to receive the parameters I havefunction UntarFiles() { if (document.RunForm.runs.selectedIndex==-1) { alert("Please make a selection from the list."); return false; } var env = document.getElementById("env").value; var runs = document.getElementById("runs").value; var url = "atlanta_combine_postscript.cgi?&env=" + escape(env) + " +&runs=" + escape(runs); request.open("GET", url, true); request.onreadystatechange = IssueAlert; request.send(null); }
However whilst what I have in the called perl program may be wrong - since I can see in the error log I'm getting the error "Can't call method "param" on an undefined value"use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); my ( $env, @runs ); $env = param('env'); @runs = $query->param('runs');
So the issue I have is that when I select multiple items, I can see that what it is trying to be passed is
rather thanatlanta_combine_postscript.cgi?&env=PROD&runs=2010-08-17 ----- 039733
atlanta_combine_postscript.cgi?&env=PROD&runs=2010-08-17 ----- 0397332010-08-17 ----- 039753
(if indeed that is how I would expect to see multiple items passed in)?
So two questions:
Can anyone see what I've done wrong to only pick up one rather than all selected items
and
Is what I've done to initially receive the data (as an array) correct?
Any help greatly appreciated as ever.
Cheers
Kev
In reply to Passing 'SELECT MULTIPLE' parameters and CGI by viffer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |