I am invoking a page (see code below) from a list of links on another page using. List like this
<ul data-role="listview" data-theme="g"> <li><a href="test.html">test</a></li> </ul>
with the code below being the test.html page.
I use jquery mobile on these pages. Only the flags after the first 3 flags appear updated (appear as marked) when the page is loaded by clicking on the link. The first three flags always seem unselected, and their checked value is set to false. Unusually, if I put an if statement right after the statement that sets the flag to true, the checked flag is checked for true, but on the displayed page it looks false, and you look at the checked value in the element area of โโthe web inspector. When you refresh the page (using F5 or the refresh button next to the address bar), the check boxes are updated as you expected. Any help would be greatly appreciated. While the code example below just sets all the checkboxes for the checked value, I really (on my real page) set their value based on the data from the recordset, so I canโt just set the mass parameter to true and refresh. I need to scroll through the recordset and set the checkbox values โโaccordingly. The code below is just a reproduction of the error I have. Thanks!
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Checkbox</title> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1"> <link rel="stylesheet" href="jqm1/jquery.mobile.structure-1.0.1.min.css" /> <script src="jqm/jquery-1.7.1.min.js"></script> <script src="jqm/jquery.mobile-1.0.1.min.js"></script> </head> <body> <div id="loadCB" data-role="page"> <script type="text/javascript"> $("#loadCB").live('pageinit', function() { </script> <article data-role="content"> <form id="frmR"> <input type="checkbox" name="checkbox-0" id="checkbox-0" class="custom" value="0"/> <label for="checkbox-0">checkbox-0</label> <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" value="1"/> <label for="checkbox-1">checkbox-1</label> <input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" value="2"/> <label for="checkbox-2">checkbox-2</label> <input type="checkbox" name="checkbox-3" id="checkbox-3" class="custom" value="3"/> <label for="checkbox-3">checkbox-3</label> <input type="checkbox" name="checkbox-4" id="checkbox-4" class="custom" value="4"/> <label for="checkbox-4">checkbox-4</label> <input type="checkbox" name="checkbox-5" id="checkbox-5" class="custom" value="5"/> <label for="checkbox-5">checkbox-5</label> <input type="submit" value="Set Rules" /> </form> </article> </body> </div> </html>
source share