title: How to set selected to option using ddSlick after postback?
body: <p>I need to use image drop-down list from <a href="http://designwithpc.com/plugins/ddslick" rel="nofollow">http://designwithpc.com/plugins/ddslick</a> I am trying to set "selected" option  after postback, but I get infinite loop of postbacks. Here is my code:</p>
  
  <pre><code>&lt;form id="form1"&gt;
  &lt;select id="localeId" name="localeId"&gt;&lt;/select&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
          //Dropdown plugin data
          var ddData = [
              {
                  text: "English",
                  value: "en",
                  selected: false,
                  description: "English",
                  imageSrc: "/assets/img/flags-icons/en-flag.png"
              },
              {
                  text: "Portuguese",
                  value: "pt",
                  selected: false,
                  description: "Portuguese",
                  imageSrc: "/assets/img/flags-icons/pt-flag.png"
              },
              {
                  text: "Russian",
                  value: "ru",
                  selected: false,
                  description: "Russian",
                  imageSrc: "/assets/img/flags-icons/ru-flag.png"
              },
              {
                  text: "Spanish",
                  value: "es",
                  selected: false,
                  description: "Spanish",
                  imageSrc: "/assets/img/flags-icons/es-flag.png"
              }
          ];
  
          $('#localeId').ddslick({
              data: ddData,
              defaultSelectedIndex: 3,
              onSelected: function (data) {
                  if (data.selectedIndex &gt; 0) {
                      $('#hidCflag').val(data.selectedData.value);
                      $.cookie('lang', document.getElementById("hidCflag").value, { expires: 365 });
                      form1.submit();
                  }
  
              }
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>Could please help me to solve it?</p>