title: Cascading dropdown empty doesnt show any value
body: <p>i try creating cascading dropwdown, i have 2 dropdown kanwil and branch when i select kanwil value branch value appear but when i select default value in branch that has value &quot;-1&quot; branch dropdown goes empty
  this is action index in controller</p>
  <pre><code> public ActionResult Index(string PrmBranch=&quot;&quot;, string PrmWilayah = &quot;&quot;)
          {
              
       
              string ParamWilayah = &quot;&quot;;
              string Parambranch = &quot;&quot;;
             
  
              if (PrmWilayah != &quot;&quot;)
              {
                  ParamWilayah = PrmWilayah.Trim();
                  ViewBag.wilayahsearch = PrmWilayah.Trim();
                  
              }
              else
              {
                  ParamWilayah = &quot;-1&quot;;
              }
  
  
  
              if ( PrmBranch !=&quot;&quot;)
              {
                  Parambranch = PrmBranch.Trim();
                  ViewBag.branchsearch = PrmBranch.Trim();
              }
              else
              {
                  Parambranch = &quot;-1&quot;;
                 
  
              }
  
              //select from database
           
          }
  
             
  </code></pre>
  <p>the view</p>
  <pre><code> @using (Html.BeginForm(&quot;Index&quot;, &quot;CreateAccount&quot;, FormMethod.Post))
  {
    Wilayah
    &lt;div class=&quot;form-group&quot;&gt;
    &lt;div class=&quot;input-group date&quot;&gt;
    &lt;select class=&quot;form-control&quot; id=&quot;WilayahDropdown&quot; name=&quot;PrmWilayah&quot; style=&quot;text-align: center&quot;&gt;&lt;/select&gt;
                                                        
   &lt;span class=&quot;input-group-addon&quot;&gt;                                                           &lt;span class=&quot;glyphicon glyphicon-institution fa fa-institution&quot;&gt;&lt;/span&gt;
    &lt;/span&gt;
    &lt;/div&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  &lt;div class=&quot;col-sm-4&quot;&gt;
                                                 
   Branch
  &lt;div class=&quot;form-group&quot;&gt;
   &lt;div class=&quot;input-group date&quot;&gt;
  &lt;select class=&quot;form-control&quot; id=&quot;BranchDropdown&quot; name=&quot;PrmBranch&quot; style=&quot;text-align: center&quot;&gt;&lt;/select&gt;
  &lt;span class=&quot;input-group-addon&quot;&gt;
  &lt;span class=&quot;glyphicon glyphicon-institution fa fa-institution&quot;&gt;&lt;/span&gt;
  &lt;/span&gt;
   &lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
   &lt;div class=&quot;form-group&quot;&gt;
  &lt;div class=&quot;input-group date&quot;&gt;
  &lt;input type=&quot;submit&quot; class=&quot;btn btn-primary&quot; value=&quot;Search&quot; name=&quot;&quot; /&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
   &lt;input type=&quot;text&quot; value=&quot;@ViewBag.wilayahsearch&quot; id=&quot;btnWilayahsearch&quot; /&gt;
  &lt;input type=&quot;text&quot; value=&quot;@ViewBag.branchsearch&quot; id=&quot;btnbranchsearch&quot; /&gt;
  }
      &lt;script type=&quot;text/javascript&quot;&gt;
          @Model.JavascriptToRun
  
  
          
          $(document).ready(function () {
              var Wilayahsearch = $('#btnWilayahsearch').val();
              var branchsearch = $('#btnbranchsearch').val();
  
  
              getWilayah();
              if (Wilayahsearch.length &gt; 0) {
                  if (Wilayahsearch == &quot;-1&quot;)  {
                      
                      getBranch();
                  }
                  else if (branchsearch != &quot;-1&quot;) {
                      getbranchselect(branchsearch);
                  }
  
                  else if (Wilayahsearch != &quot;-1&quot;) {
                      getwilayahselect(Wilayahsearch);
                      getBranchWil();
                  }
              }
              else if (branchsearch.length &lt; 0) {
                  getbranch();
  
              }
              else {
                  getBranchWil();
              }
  });
  function getBranchWil() {
              $.ajax({
                  type: &quot;GET&quot;,
                  url: '@Url.Content(&quot;~/CreateAccount/getBranchWil&quot;)',
                  data: { kanwil: $('#btnWilayahsearch').val() },
                  success: function (data) {
                      var s = '&lt;option value=&quot;-1&quot;&gt;--- Branch ---&lt;/option&gt;';
                      for (var i = 0; i &lt; data.length; i++) {
                          s += '&lt;option value=&quot;' + data[i].Branch + '&quot;&gt;' + data[i].Branch + ' - ' + data[i].Branch_Name + '&lt;/option&gt;';
                      }
                      $(&quot;#BranchDropdown&quot;).html(s);
                  }
              });
          }
  
          function getWilayah() {
              $.ajax({
                  type: &quot;GET&quot;,
                  url: '@Url.Content(&quot;~/CreateAccount/getWilayah&quot;)',
                  data: &quot;{}&quot;,
                  success: function (data) {
                      var s = '&lt;option value=&quot;-1&quot;&gt;--- Wilayah ---&lt;/option&gt;';
                      for (var i = 0; i &lt; data.length; i++) {
                          s += '&lt;option value=&quot;' + data[i].Kanwil + '&quot;&gt;' + data[i].Kanwil + ' - ' + data[i].Kanwil_Name + '&lt;/option&gt;';
                      }
                      $(&quot;#WilayahDropdown&quot;).html(s);
                  }
              });
          }
          function getwilayahselect(e) {
              $.ajax({
                  type: &quot;GET&quot;,
                  url: '@Url.Content(&quot;~/CreateAccount/getWilayah&quot;)',
                  data: &quot;{}&quot;,
                  success: function (data) {
                      var namaWilayah = &quot;&quot;;
                      for (var i = 0; i &lt; data.length; i++) {
                          if (data[i].Kanwil == e.trim()) {
                              namaWilayah = data[i].Kanwil_Name;
                          }
                      }
  
                      var s = '&lt;option value=&quot;' + e + '&quot;&gt;' + e + ' - ' + namaWilayah + '&lt;/option&gt;';
                      s += '&lt;option value=&quot;-1&quot;&gt;--- Wilayah ---&lt;/option&gt;';
                      for (var i = 0; i &lt; data.length; i++) {
                          if (data[i].Kanwil != e.trim()) {
                              s += '&lt;option value=&quot;' + data[i].Kanwil + '&quot;&gt;' + data[i].Kanwil + ' - ' + data[i].Kanwil_Name + '&lt;/option&gt;';
                          }
                      }
  
                      $(&quot;#WilayahDropdown&quot;).html(s);
                  }
              });
          }
  
  
          function getbranch() {
              $.ajax({
                  type: &quot;GET&quot;,
                  url: '@Url.Content(&quot;~/CreateAccount/getBranch&quot;)',
                  data: &quot;{}&quot;,
                  success: function (data) {
                      var s = '&lt;option value=&quot;-1&quot;&gt;--- Branch ---&lt;/option&gt;';
                      for (var i = 0; i &lt; data.length; i++) {
                          s += '&lt;option value=&quot;' + data[i].Branch + '&quot;&gt;' + data[i].Branch + ' - ' + data[i].Branch_Name + '&lt;/option&gt;';
                      }
                      $(&quot;#BranchDropdown&quot;).html(s);
                  }
              });
          }
  </code></pre>
  <p>which part should i change or any recommendation? thanks</p>