Page 109 - JqueryMobile_Manual
P. 109

109

                                            Change the text on the flip switch
                                             tryjqmob_forms_select_switch_text.html
               <!DOCTYPE html>
               <html>
               <head>
               <meta name="viewport" content="width=device-width, initial-scale=1">
               <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
               <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
               <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
               </head>
               <body>

               <div data-role="page">
                 <div data-role="main" class="ui-content">
                   <form method="post" action="/action_page_post.php">
                     <label for="switch">Flip Toggle Switch:</label>
                       <input type="checkbox" data-role="flipswitch" name="switch" id="switch" data-on-text="True" data-
               off-text="False">
                       <br>
                     <input type="submit" data-inline="true" value="Submit">
                   </form>
                 </div>
               </div>

               </body>
               </html>

                                                  Pre-select a flip switch
                                           tryjqmob_forms_select_switch_selected.html
               <!DOCTYPE html>
               <html>
               <head>
               <meta name="viewport" content="width=device-width, initial-scale=1">
               <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
               <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
               <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
               </head>
               <body>

               <div data-role="page">
                 <div data-role="main" class="ui-content">
                   <form method="post" action="/action_page_post.php">
                     <label for="switch">Flip Toggle Switch:</label>
                       <input type="checkbox" data-role="flipswitch" name="switch" id="switch" checked>
                       <br>
                     <input type="submit" data-inline="true" value="Submit">
                   </form>
                 </div>
               </div>

               </body>
               </html>
   104   105   106   107   108   109   110   111   112   113   114