jQuery Mobile - .select('refresh') not working
My code works perfect until I add the jquery mobile styling to the selectbox and they no longer refresh correctly. The second selectbox is populated with ajax. After reading around I've found that I need to issue a refresh on the selectbox but I can't seem to get it to work. I'm not massively familiar with AJAX but when the boxes are un-styled with 'data-role = none' it works as expected, so it seems to be a problem with jQuery mobile.
Edit: I should mention I followed the following tutorial:
http://amecms.com/article/Building-Chained-Select-Boxes-with-Jquery-and-PHP
<form action="" method="post"> <select id="makes" name="makes"> <option value="Acura">Acura</option> <option value="BMW">BMW</option> <option value="Lexus">Lexus</option> <option value="Toyota">Toyota</option> <option value="Honda">Honda</option> </select> <select id="models" name="models"> </select> <input type="submit" name="submit" value="Submit"> </form> <script> $('#makes').change(function(){ var make = $(this).val(); $.post('select-request2.php', {make:make}, function(data){ $('#models').html(data); }); $('#models').selectmenu('refresh', true); }); </script>