title: Jquery mobile - Refreshing checkboxes with pageinit
body: <p>I am calling a page (see code below) from a list of links on another page using. A list like this</p>
  
  <pre><code>&lt;ul data-role="listview" data-theme="g"&gt;
        &lt;li&gt;&lt;a href="test.html"&gt;test&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>with the code below being the test.html page.</p>
  
  <p>I am using jquery mobile on these pages. Only the checkboxes after the first 3 checkboxes seem to get refreshed properly (appear as checked) when the page is loaded by clicking on the link. The first three checkboxes always appear to be unselected and their checked value is set to false. What is unusual is that if I place an if statement right after the statement that is setting the checkbox to true the checkbox checked value evaluates to true, but appears to be false on the rendered page and you look at the checked value in the elements area of the web inspector. When you refresh the page (using F5 or the refresh button near the address bar) the checkboxes refresh as you would expect. Any help would be greatly appreciated. While the sample code below appears to just be setting all the checkboxes to a checked value I am really (in my real page) setting their value based on data from a recordset so I cannot just do a mass setting to true and refresh. I have to loop through the recordset and set the checkbox values accordingly. The code below is just a simple reproduction of the error I am having. Thank you!</p>
  
  <pre><code>&lt;!doctype html&gt; 
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;title&gt;Checkbox&lt;/title&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1"&gt;
              &lt;link rel="stylesheet" href="jqm1/jquery.mobile.structure-1.0.1.min.css" /&gt;
              &lt;script src="jqm/jquery-1.7.1.min.js"&gt;&lt;/script&gt;
              &lt;script src="jqm/jquery.mobile-1.0.1.min.js"&gt;&lt;/script&gt;
  
          &lt;/head&gt;
          &lt;body&gt;
          &lt;div id="loadCB" data-role="page"&gt;
              &lt;script type="text/javascript"&gt;
                  $("#loadCB").live('pageinit', function() {
                      // do something here...
  
  
                      for (i=0;i&lt;=5;i++)
                      {
                      $("#checkbox-"+i).prop("checked", true);
                      $("#checkbox-"+i).prop("checked", true).checkboxradio("refresh");
                      }
  
  
                  });
              &lt;/script&gt;
  
              &lt;article data-role="content"&gt;
  
  
                  &lt;form id="frmR"&gt;
                      &lt;input type="checkbox" name="checkbox-0" id="checkbox-0" class="custom" value="0"/&gt;
                      &lt;label for="checkbox-0"&gt;checkbox-0&lt;/label&gt; 
                      &lt;input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" value="1"/&gt;
                      &lt;label for="checkbox-1"&gt;checkbox-1&lt;/label&gt; 
                      &lt;input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" value="2"/&gt;
                      &lt;label for="checkbox-2"&gt;checkbox-2&lt;/label&gt; 
                      &lt;input type="checkbox" name="checkbox-3" id="checkbox-3" class="custom" value="3"/&gt;
                      &lt;label for="checkbox-3"&gt;checkbox-3&lt;/label&gt; 
                      &lt;input type="checkbox" name="checkbox-4" id="checkbox-4" class="custom" value="4"/&gt;
                      &lt;label for="checkbox-4"&gt;checkbox-4&lt;/label&gt; 
                      &lt;input type="checkbox" name="checkbox-5" id="checkbox-5" class="custom" value="5"/&gt;
                      &lt;label for="checkbox-5"&gt;checkbox-5&lt;/label&gt; 
  
                      &lt;input type="submit" value="Set Rules" /&gt;
                 &lt;/form&gt;             
  
  
              &lt;/article&gt;           
          &lt;/body&gt;
       &lt;/div&gt;   
      &lt;/html&gt;
  </code></pre>