Gurus,

I've created the following file (see HTML/JavaScript code below) which
allows end-users to dynamically (on the client-side) move items from one
form select list (called "list_managers" to another (called simply
"managers[]").  When, however, I attempt to access the end-user created
"managers[]" form select list with PHP, I'm unable to do so!  My testing
(using the empty and isset functions) revealed that the "managers[]" array
shows up as being empty, even though items were added to it from the
"list_managers" select list prior to the form's submission.  Has anyone
encountered this problem before?  What am I doing wrong here?  Are there any
suitable workarounds?

P.S.  Thank you, in advance, for all of your help and cooperation.


*********
HTML/JavaScript code starts
**********

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
        <title>UPLOADS</title>
        <script language="javascript" type="text/javascript">
        <!-- begin hide
        function onOptions(formName,toFieldName,fromFieldName){
                var deptIndex =
document[formName][fromFieldName].selectedIndex;
                if (deptIndex>0){
                        selectedArea = document[formName][fromFieldName];
            }
                for (j=1;j<selectedArea.length;j++){
                        var noError = true;
                        if (selectedArea.options[j].selected){
                                selectedText = selectedArea.options[j].text;
                                selectedValue =
selectedArea.options[j].value;
                                for
(i=1;i<document[formName][toFieldName].length;i++){
                                        if
(document[formName][toFieldName].options[i].value == selectedValue){
//duplication
                                                alert("Duplication: " +
selectedText);
                                                noError = false;
                                        }
                                }
                                if (noError){
                                        var len =
document[formName][toFieldName].length;

document[formName][toFieldName].options[len] = new Option(selectedText,
selectedValue);
                                }
                        }
                }
        }
        function offOptions(formName,fieldName){
                for (i=1;i<document[formName][fieldName].length; i++){
                        if
(document[formName][fieldName].options[i].selected){
                                document[formName][fieldName].options[i] =
null;
                                i--;
                        }
            }
        }
        // end hide-->
        </script>
</head>
<body>
<table width="530" cellpadding="0" cellspacing="0" border="0">
        <form name="formName" enctype="multipart/form-data" action="<?php
echo $PHP_SELF; ?>" method="post">
        <input type="hidden" name="MAX_FILE_SIZE" value="102400">
                <tr>
                        <td width="530" height="25" valign="top"
colspan="2"><font class="required">*</font> <b>File:</b><br><input
type="file" name="file" value="" size="68"></td>
                </tr>
                <tr>
                        <td width="530"
valign="top">Description:<br><textarea name="file_description" cols="79"
rows="5">An internal file for authorized administrators
only.</textarea></td>
                </tr>
                <tr>
                        <td width="530" valign="top">
                                <table width="530" cellpadding="0"
cellspacing="0" border="0">
                                        <tr>
                                                <td width="530" valign="top"
colspan="3">choose managers</td>
                                        </tr>
                                        <tr>
                                                <td width="530" valign="top"
colspan="3">
                                                        <select
name="list_managers" size="5" multiple>
                                                                <option
value="">----------------------------------</option>
                                                                <option
value="1">test 1</option>
                                                                <option
value="2">test 2</option>
                                                                <option
value="3">test 3</option>

                                                        </select>
                                                        <a
href="javascript:onOptions('formName','managers[]','list_managers');">ADD</a
> | <a href="javascript:offOptions('formName','managers[]');">REMOVE</a>
                                                        <select
name="managers[]" size="5" multiple>
                                                                <option
value="">----------------------------------</option>
                                                        </select>
                                                </td>
                                        </tr>
                                        <tr>
                                                <td width="530" valign="top"
colspan="3">Hold down CTRL key to select mutiple members</td>
                                        </tr>
                                </table>
                        </td>
                </tr>
                <tr>
                        <td height="30" valign="top" colspan="2">&nbsp;</td>
                </tr>
                <tr>
                        <td valign="top" colspan="2">
                                <input type="submit" name="submit"
value="UPLOAD FILE">
                                &nbsp;&nbsp;&nbsp;
                                <input type="reset" name="reset"
value="RESET">
                                &nbsp;<br>
                                <font class="required">*</font> <b>x:</b> =
required form field.
                        </td>
                </tr>
                <tr>
                        <td height="30" valign="top" colspan="2">&nbsp;</td>
                </tr>
        </form>
</table>
</body>
</html>


*********
HTML/JavaScript code stops
**********


O    C:\DOS
\->  C:\DOS\RUN
/\   RUN\DOS\RUN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to