try this,
<form name="f1">
<select name="selectall[]">
<option>line1</option>
<option selected>line2</option>
<option>line3</option>
</select>
<input type="text" name="txt1">
</form>
<script language="JavaScript">
<!--
selectobjname = "selectall[]";
selectobj = null;
for (i=0; i< f1.elements.length; i++)
{
if (f1.elements[i].name == selectobjname)
{
alert('found element, and got a pointer of it');
selectobj = f1.elements[i];
}
else
alert(f1.elements[i].name);
}
alert('currently selected item:' +
selectobj.options[selectobj.selectedIndex].text);
//-->
</script>
should help you out!
-elias
http://eassoft.cjb.net
""Nicolas Guilhot"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I've got a select tag with multiple selection enabled. When the user
submit
> the form, I want to pass all options from the select to another page. For
> this I use javascript to select every element in my select tag. My
problem,
> is that in PHP, to access all selected elements in an array, I need to
give
> my select tag a name like 'myselect[]'. If I use this naming, I can't use
my
> Javascript code to select every element before submitting the form.
>
> How can I get both thing to work : my javascript code to select every
> element, and my php code to access every element ??
>
> Thanks for any answer.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]