Dear Friend,
you can do in this manner also
optmselected.htm
<html>
<body>
<script language=javascript>
function validate()
{
temp="";
with(document.frm.choice)
{
st=0;
for(var loopIndex=0;loopIndex<length;loopIndex++)
{
if(options[loopIndex].selected)
{
temp=temp+" "+options[loopIndex].value;
}
}
}
document.frm.experience.value=temp;
return true;
}
</script>
<FORM name=frm METHOD="POST" ACTION="foo.php"
ENCTYPE="application/x-www-form-urlencoded" onSubmit="return validate()">
Computer Experience:<BR>
<SELECT MULTIPLE NAME="choice" SIZE="3">
<OPTION VALUE="Less than 1 year.">Less than 1 year.
<OPTION VALUE="1-5 years.">1-5 years.
<OPTION VALUE="5-10 years.">5-10 years.
<OPTION VALUE="More than 10 years.">More than 10 years.
</SELECT>
<BR>
<input type=hidden name=experience>
<INPUT TYPE="reset">
<INPUT TYPE="submit" VALUE="Submit">
</FORM>
</body></html>
foo.php
<?php
$exp=$_POST["experience"];
if($exp!="")
{
$toka=" ";
$tok=strtok($exp,$toka);
while($tok)
{
echo $tok."<br>";
$tok=strtok(" ");
}
}
?>
regards
bvsureshbabu