Search code examples
javascriptapidropbox

How to implement multiple Dropbox Javascript Choosers on a page?


Dropbox's official page teaches how to implement a single chooser, but doesn't teach how to implement multiple choosers on a page.

Is it possible to do that?


Solution

  • Yes, this is possible. The createChooseButton method can be used multiple times to create multiple Chooser buttons that you can put wherever you want. E.g.:

            var button = Dropbox.createChooseButton(options);
            document.getElementById("container").appendChild(button);
    
            var button2 = Dropbox.createChooseButton(options2);
            document.getElementById("container").appendChild(button2);