Jquery mobile popup form not submitting or firing click -


so have popup form directly jquery mobile website, displayed below. in script file have call intended fire on button click. i'm not sure why happening.

popup form:

  <div data-role="popup" id="popuplogin" data-theme="a" class="ui-corner-all">     <form>         <div style="padding:10px 20px;">             <h3>please sign in</h3>             <label for="un" class="ui-hidden-accessible">username:</label>             <input name="user" id="un" value="" placeholder="username" data-theme="a" type="text">             <label for="pw" class="ui-hidden-accessible">password:</label>             <input name="pass" id="pw" value="" placeholder="password" data-theme="a" type="password">             <button id="admin_btn" class="ui-btn ui-corner-all ui-shadow ui-btn-b ui-btn-icon-left ui-icon-check">sign in</button>         </div>     </form>   </div> 

the button tag used of type "submit", decided take out , make generic button, test if clicked through id. not sure if means anything.

script.js:

$(document).ready() {     $('#admin_btn').click(function(){         alert("here");     });   } 

use these code:

$(document).ready() { $(document).on("click","#admin_btn",function(){     alert("here"); });   } 

you can check difference here link .


Comments