Problem with dialog on iPhone/iPad

Problem with dialog on iPhone/iPad

I have a popup dialog that should be opened when a button is pressed.  It works properly on desktop browsers and on Droid.  On iPhone and iPad (Safari) I discovered that it wasn't opening.  If the page containing the button is refreshed it will work.  I took it to Safari and Chrome on the desktop and changed the useragent to iPhone.  It works properly on Safari.  With Chrome it is the same behavior as the iPhone/iPad.  Will not work unless the page is refreshed.

I have taken the page source after initial load (when it is not working) and after refresh (when it is working) and used WinDiff to compare the two.  They are identical.

Here is the markup for the button that should open the dialog:

  1. <a href="#popup" data-role="button" data-rel="dialog" data-icon="gear" data-iconpos="right" data-transition="pop">Choose Date</a> 
Here is the markup for the dialog:

  1. <div data-role="dialog" id="popup">

  2. <div data-role="header" data-theme="b">
  3. <h1>Production Date</h1>
  4. </div>

  5. <div data-role="content" data-theme="b">
  6. <form action="/mobileDemo/ExecDash/Body/1" method="post">
  7. <div data-role="fieldcontainer">
  8. <p>Hello World</p>
  9. </div>
  10. <button type="submit" data-theme="b">Select</button>
  11. </form>

  12. </div>

  13. </div>
My markup and page structure are correct.  JQM pages structure properly.  Since this is a dialog it is a multi-page.  I have used tools to ensure that all elements are properly closed.  For full disclosure below is the page source for the entire page.


  1. <!DOCTYPE html> 
  2. <html> 
  3. <head> 
  4. <meta charset="utf-8" />
  5. <title>Body Dashboard for System 1</title> 
  6. <meta name="viewport" content="width=device-width" />
  7. <meta name="apple-mobile-web-app-capable" content="yes" />
  8. <link rel="stylesheet" href="/mobileDemo/Scripts/jquery.mobile-1.2.0.min.css" />
  9. <script type="text/javascript" src="/mobileDemo/Scripts/jquery-1.8.2.min.js"></script>
  10. <script type="text/javascript">
  11. $(document).bind("mobileinit", function () {
  12. // As of Beta 2, jQuery Mobile's Ajax navigation does not work in all cases (e.g.,
  13. // when navigating from a mobile to a non-mobile page), hence disabling it.
  14. $.mobile.ajaxEnabled = false;
  15. });
  16. </script>
  17. <script type="text/javascript" src="/mobileDemo/Scripts/jquery.mobile-1.2.0.min.js"></script>

  18.         <link rel="icon" href="/mobileDemo/images/icon_pmcsmobile_32.png" />
  19.         <link rel="shoftcut icon" href="/mobileDemo/images/icon_pmcsmobile_32.png" />
  20.         <link rel="apple-touch-icon" href="/mobileDemo/images/icon_pmcsmobile_57.png" />
  21.         <link rel="apple-touch-icon" href="/mobileDemo/images/icon_pmcsmobile_114.png" sizes="114x114" />
  22.         <link rel="apple-touch-icon" href="/mobileDemo/images/icon_pmcsmobile_72.png" sizes="72x72" />
  23.         <link rel="apple-touch-icon" href="/mobileDemo/images/icon_pmcsmobile_80.png" sizes="80x80" />
  24.         <link rel="apple-touch-icon" href="/mobileDemo/images/icon_pmcsmobile_57.png" sizes="android-only" />

  25. </head> 

  26. <body> 

  27. <div data-role="page" id="mainpage" data-theme="b">
  28. <div data-role="header" data-theme="b" data-position="fixed">
  29. <center>
  30. <a href="/Home/Main"><img src="/mobileDemo/Images/company_header_logo_mobile.png" border="0" /></a>
  31. </center>
  32. </div>

  33. <div style="text-align: center; padding-top:5px">

  34. <center>
  35. <a href="/mobileDemo/Home/Main"><img src="/mobileDemo/Images/menu_home.png" style="width: 40px" border="0" /></a>
  36. <a href="/mobileDemo/Counts"><img src="/mobileDemo/Images/menu_prodcounts.png" style="width: 40px" border="0" /></a>
  37. <a href="/mobileDemo/Inventory"><img src="/mobileDemo/Images/menu_inventory.png" style="width: 40px" border="0" /></a>
  38. <a href="/mobileDemo/Vehicle"><img src="/mobileDemo/Images/menu_vehicle.png" style="width: 40px" border="0" /></a>
  39. <a href="/mobileDemo/SSAR"><img src="/mobileDemo/Images/menu_ssar.png" style="width: 40px" border="0" /></a>
  40. <a href="/mobileDemo/STAR"><img src="/mobileDemo/Images/menu_star.png" style="width: 40px" border="0" /></a>
  41. <a href="/mobileDemo/EXECDASH"><img src="/mobileDemo/Images/menu_dashboard.png" style="width: 40px" border="0" /></a>
  42. </center>

  43. </div>

  44. <div style="padding-left: 20px; padding-top: 10px">
  45. <strong>Body Dashboard for System 1</strong>
  46. </div>

  47. <div style="padding-right: 15px; padding-left: 15px; padding-top: 10px">

  48. <a href="#popup" data-role="button" data-rel="dialog" data-icon="gear" data-iconpos="right" data-transition="pop">11/7/2012</a>
  49. <hr />
  50. <ul data-role="listview" data-inset="true">
  51. <li><a href="/mobileDemo/ExecDash/BodyProd/1/11-07-2012">Production</a></li>
  52. <li><a href="/mobileDemo/ExecDash/BodyOEE?system=1&amp;date=11-07-2012">Body OEE</a></li>
  53. <li><a href="/mobileDemo/ExecDash/BodyDKS?system=1&amp;date=11-07-2012">Doukie-Seisan KPI</a></li>
  54. <li><a href="/mobileDemo/ExecDash/BodyDT?system=1&amp;date=11-07-2012">Down Time</a></li>
  55. </ul>
  56. </div>

  57. </div>


  58. <div data-role="dialog" id="popup">

  59. <div data-role="header" data-theme="b">
  60. <h1>Production Date</h1>
  61. </div>

  62. <div data-role="content" data-theme="b">
  63. <form action="/mobileDemo/ExecDash/Body/1" method="post">
  64. <div data-role="fieldcontainer">
  65. <p>Hello World</p>
  66. </div>
  67. <button type="submit" data-theme="b">Select</button>
  68. </form>

  69. </div>

  70. </div>



  71. </body>
  72. </html>