Login Register

Programmatic MultiSelect

I get an error trying to create a MultiSelect programmatically.

The error is around line 21 as says: "Object doesn't support this property or method"

Has anyone had any success doing this?

Source:

<html>
<head>

<title></title>

    <style type="text/css">
        @import "/dojoroot/dijit/themes/tundra/tundra.css";
        @import "/dojoroot/dojo/resources/dojo.css";
    </style>
    <style> 
        /* NOTE: for a full screen layout, must set body size equal to the viewport. */
        html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
        
     
    </style>
    
    <script type="text/javascript">
        djConfig = {
            parseOnLoad: true,
            debug: true
        };
    </script>
    <script type="text/javascript" src="/dojoroot/dojo/dojo.js"></script>
    <script type="text/javascript">

            dojo.require("dijit.form.MultiSelect");
            
            dojo.addOnLoad(function() {
                
                new dijit.form.MultiSelect({},dojo.byId("multiselect"));
                
               });
    </script>
</head>
<body>
    <select id="multiselect" multiple="true"></select>
</body>
</html>

there is nothing wrong

i've c/p your html page and tested it. it's working fine. at least with latest dojo version. :)