www.webdeveloper.com
Results 1 to 3 of 3

Thread: Select Multiple on Form Dropdown

  1. #1
    Join Date
    Sep 2013
    Posts
    2

    Select Multiple on Form Dropdown

    I need some assistance changing a single select into a multiple select form drop-down. I am having issues with the multiple selections storing. The function loops through all of the users and assigns a drop-down where I can select the folder they have access to. I'm not having any luck trying to assign more than one folder to each user. Thank you for your help!

    PHP Code:
    $var "
                <script type='text/javascript'>
                jQuery(function(){

                         jQuery('form').attr('method', 'get');
                         jQuery('form').after('<input type=\"submit\"  id=\"doaction_k2\" class=\"button-secondary action\" value=\"Apply Folder Access\" style=\"background: red; color: #fff;\">');


                    var thisurl = '';
                    var thaturl = '';
                    jQuery('#doaction_k2').live('click', function(){
                           jQuery('.new_file_access').each(function(){
                            thisurl = thisurl + '|' + jQuery(this).attr('userid') + '~' + jQuery(this).val();
                           });

                           jQuery('.new_file_readwrite').each(function(){
                            thaturl = thaturl + '|' + jQuery(this).attr('userid') + '~' + jQuery(this).val();
                           });

                        jQuery.post(document.URL, { update_access: 1, file_access: thisurl, file_readwrite: thaturl }, function(){
                            window.location = document.URL;
                        });

                        return false;
                        });
                    });

                </script>"
    ;
            }

                
    $var .= "<select multiple='yes' id='file_manager_accessk".$user_id."' class='new_file_access' userid='$user_id'><option value='' $noaccess>No Access</option>";

                foreach(
    $ACCESS_ARRAY as $key=>$value)
                {
                        
    $key str_replace('\\''/'$key);
                        
    $keys $key .'~'$urls.'/'.$value;
                        
    $keys substr($keys0strlen($keys)-1);
                        
    $keys1 base64_encode($keys);

                        
    $var .= "<option value='$keys1$select[$keys]>$value</option>";
                }
                
    $var .= "</select>";
                return 
    $var;
                break; 

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,603
    I'm guessing we'll need to see where/how $ACCESS_ARRAY is assigned its values.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Sep 2013
    Posts
    2
    Here is the array of folders that are assigned to $ACCESS_ARRAY. Thanks!

    PHP Code:
    $ACCESS_ARRAY = array(1=>'All Files'2=>'wp-admin'3=>'wp-content'4=>'wp-includes'5=>'plugins'6=>'themes'7=>'None'); 
    Quote Originally Posted by NogDog View Post
    I'm guessing we'll need to see where/how $ACCESS_ARRAY is assigned its values.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles