title: Reselect checkboxes after Post in included file
body: <p>I have page Search.asp (code below). And Filtered.asp which include Search.asp.</p>
  <pre><code>             &lt;%
                  Dim CheckForCheckboxes
                  CheckForCheckboxes = Request.form(&quot;chkBoxes&quot;)
                  response.write &quot;CheckForCheckboxes&quot; &amp; CheckForCheckboxes
                  %&gt;    
                  &lt;div  id=&quot;ExSearch&quot; name=&quot;ExSearch&quot; &gt;
                      &lt;script&gt;
    // on page load check if this page called from POST and have passed checkboxes to select                  
                      var str = '&lt;%=CheckForCheckboxes%&gt;'; // {&quot;Make[]&quot;:[&quot;AIXAM&quot;,&quot;CADILLAC&quot;,&quot;JEEP&quot;],&quot;selCountry[]&quot;:[&quot;5&quot;,&quot;4&quot;,&quot;8&quot;]}
                      if (!str || str.length === 0) {} else {
                          var Checked = JSON.parse(str); 
  // alert works here
          // This one not work
                          $(&quot;#ExSearch&quot;).find('div.list input[type=radio], input[type=checkbox],div.selector select').each(function () {
  // alert do not work here
                              var $el = $(this);
                              var name = $el.attr('name');
                              var value = $el.attr('value');
                              if (Checked[name] &amp;&amp; Checked[name].indexOf(value) !== -1 ) {$el.prop('checked', true);}
                          });
                      };
                      
       // from here function which select checkboxes and hold them in hidden input field before submit, on submit pass this object with form               
                      $(function() {
                      
                          $('div.list input[type=checkbox], input[type=radio]').on('change',onValueChange);     
                          $('div.selector select').on('change', onValueChange);
                      
                          function onValueChange() {      
                                  var Checked = {};
                                  var Selected = {};
                                  
                              // Hold all checkboxes
                                  $('div.list input[type=radio]:checked, input[type=checkbox]:checked').each(function () {
                                      var $el = $(this);
                                      var name = $el.attr('name');
                                      if (typeof (Checked[name]) === 'undefined') {Checked[name] = [];}
                                      Checked[name].push($el.val());
                                  });
                              // Hold all dropdowns
                                  $('div.list select').each(function () {
                                      var $el = $(this);
                                      var name = $el.attr('name');
                                      if (!!$el.val()) {Selected[name] = $el.val();}
                                  });
                      
                          // Put all together to POST 
                              $.ajax({
                                  url: '/Search.asp',
                                  type: 'POST',
                                  data: $.param(Selected) + &quot;&amp;&quot; + $.param(Checked),
                                  dataType: 'text',
                                  success: function (data) {
              // Put response data to page and reselect checkboxes, this works good
                                      $(&quot;#ExSearch&quot;).html(data).find('div.list input[type=radio], input[type=checkbox],div.selector select').each(function () {
                                          var $el = $(this);
                                          var name = $el.attr('name');
                                          var value = $el.attr('value');
                                          if (Checked[name] &amp;&amp; Checked[name].indexOf(value) !== -1 ) {$el.prop('checked', true);}
                                          if (Selected[name]) {$el.val(Selected[name]);}
                                      });
      // Hold converted object to string values
                                      $(&quot;&lt;input type='hidden' value='' /&gt;&quot;).attr(&quot;id&quot;, &quot;chkBoxes&quot;).attr(&quot;name&quot;, &quot;chkBoxes&quot;).attr(&quot;value&quot;, JSON.stringify(Checked)).prependTo(&quot;#ajaxform&quot;);
                                  }
                              });
                          };
                      });
                      
                      &lt;/script&gt;   
                      
                      &lt;form name=&quot;ajaxform&quot; id=&quot;ajaxform&quot; action=&quot;Filtered.asp&quot; method=&quot;POST&quot;&gt;
                      &lt;/form&gt;
                      &lt;/div&gt;
  </code></pre>
  <p>So If page Search.asp starting I check if object passed via form post method, and if passed I need to select checkboxes which is in this object.
  So I create object, then I convert it to string with Json.stringify and then catch form post string and convert back to object with JSON.parse</p>
  <p>So everything look ok but checkboxes is not selecting and no errors appears.</p>
  <p>What now is wrong?</p>