title: populate combobox with java script
body: <p>i am write some code for cascading drop down with dojo ajax first drop down is static and second one is fetch the data from servlet .. i am using the dijit.form.ComboBox for make dropdown. Dojo provide the Store property in which he store the data and then put it into combobox. in servlet i through the array list to ajax function .. in ajax function i separate the array with comma and strore in variable and then store in the dojo's store property But i am not able to populate the whole string .. it populate only the last value of the string i am using following code</p>
  
  <pre><code>    &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
  
          &lt;link rel="stylesheet" href="dojo/dijit/themes/claro/document.css"&gt;
          &lt;link rel="stylesheet" href="dojo/dijit/themes/claro/claro.css" /&gt;
          &lt;script src='dojo/dojo/dojo.js' data-dojo-config=' parseOnLoad: true'&gt;&lt;/script&gt;
          &lt;script&gt;
  
  
  
              require(["dojo/parser", "dijit/form/ComboBox","dijit/form/TextBox"]);
  
        function abc(){    
  
            var j = document.getElementById('state').value
            dojo.xhrPost({
      // The URL to request
      url: "populate",   //servlet name
      timeout :  3000 ,
      content: {
          username: dojo.byId("state").value
  
      },
  
      load: function(result) {    // the value in result is like=[Abas Store, Accounts ]
  
      require([
      "dojo/ready", "dojo/store/Memory", "dijit/form/ComboBox"
  ], function(ready, Memory, ComboBox){
  
       var ss=result.split(",");
  
       var i;
       for (i=1;i&lt; ss.length ;i++){
  
  
      var stateStore = new Memory({
  
          data: [ {name:ss[i], id: ss[i]}  ]
      });
       }
  
      ready(function(){
          var comboBox = new ComboBox({
              id: "stateSelect",
             name:"select",
              value: "Select",
              store: stateStore,
              searchAttr: "name"
          }, "stateSelect");
      });
  });
  
        }
  });
        }
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body class="claro"&gt;
  
       &lt;select data-dojo-type="dijit.form.ComboBox" id="state" name="state"  onchange="abc();"&gt;
      &lt;option selected &gt;Andaman Nicobar&lt;/option&gt;
      &lt;option&gt;Andhra Pradesh&lt;/option&gt;        
   &lt;option&gt;Tripura&lt;/option&gt;
   &lt;option&gt;Uttar Pradesh&lt;/option&gt;
   &lt;option&gt;Uttaranchal&lt;/option&gt;
   &lt;option&gt;West Bengal&lt;/option&gt;
  
  &lt;/select&gt;
          &lt;input id="stateSelect"  &gt;
                     &lt;/select&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>please give me solution .. to populate all the value in combobox which is i get from array list</p>