RE: [PHP] problem of javascript with dropdown list of array.
| From: | John W. Holmes | Date: | Wed, 06 Nov 2002 03:24:36 +0000 |
| Subject: | RE: [PHP] problem of javascript with dropdown list of array. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122920@lists.php.net to get a copy of this message | ||
I think you have to refer to it as document.form.element[0], element[1],
etc, based on the element number of your select box.
Anyway, ask on a Javascript list for more information.
---John Holmes...
> -----Original Message-----
> From: Mack [mailto:mplescano2000@yahoo.com]
> Sent: Monday, November 04, 2002 8:30 AM
> To: php-general@lists.php.net
> Subject: [PHP] problem of javascript with dropdown list of array.
>
>
>
> i have a problem with the dropdown list when proccesing with
javascript,
> the
> name of the dropdown list is "select02[]", this because to that i need
it
> passed in php a array of the selecteds item, for example :
> $form[select02][$i],..but i wish to fill the dropdown list from
> javascript and later submit, but it is not function, i suppose that
the
> name
> of the dropdown list is not valid name for javascript.
>
> anybody can help me?
>
> the function of javascript:
>
> function one2two(m1,m2) {
> m1text = m1.value;
> if (m1text != "" ) {
> m2len = m2.length;
> m2.options[m2len]= new Option(m1text);
> m2.options[m2len].value = m1text;
> m1.value = "";
> }
>
>
>
> -----------------------------------------------------------
> the form with the events:
>
> <form name="entryform" enctype="multipart/form-data"
> method="post"
> action="/ayni2/admin2/producto.php">
>
> <select name="select02[]" size="5" multiple></select>
> <input type="text" name="text01">
> <input name="button" type="button" onClick="one2two(text01,
select02[])"
> value=" insertar ">
> <input type="button" onClick="borrar(select02)" value=" borrar
> ">
> -----------------------------------------------------------------
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php