RE: [PHP] problem of javascript with dropdown list of array.
| From: | Martin Towell | Date: | Wed, 06 Nov 2002 03:12:30 +0000 |
| Subject: | RE: [PHP] problem of javascript with dropdown list of array. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122919@lists.php.net to get a copy of this message | ||
you can refer to form elements by:
document.forms["formname"].elements["elementname"]
so you could use:
document.forms["entryform"].elements["select02[]"]
-----Original Message-----
From: Mack [mailto:mplescano2000@yahoo.com]
Sent: Tuesday, November 05, 2002 12: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