Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple values

Status
Not open for further replies.

vpalag

Programmer
Apr 28, 2002
11
IN
Hi,


I have the following dropdown.

<select name=&quot;branchmenu&quot; multiple=&quot;true&quot;>
<option value=&quot;1&quot;>1</option>
<option value=&quot;2&quot;>2</option>
<option value=&quot;3&quot;>3</option>
</select>

I have the follwoing code in perl
$val= $cgi->{'form'}{'branchmenu'};

when i am selecting single value it is working perfect.

Iwant to select multiple values If i select multiple values in that time above perl line it is displaying ARRAY(09XXCC) some thing like this.

any body help me to fix this error.

Thanx in advance


 
not familira with the cgimethods, but
@vals= @{$cgi->{'form'}{'branchmenu'}} ;
will give you the array of values you want
and should also work for single values.
If not you can try
if ref($cgi->{'form'}{'branchmenu'}) eq 'ARRAY'){
@vals= @{$cgi->{'form'}{'branchmenu'}} ;}
else{$val= $cgi->{'form'}{'branchmenu'};}

svar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top