mobile jquery onclick is not working



If on click on webview in android is not working, try the below

<div data-role="page" id="areaformpage">
   <div data-role="content">
<!-- your divs-->
<!--your form -->
  </div>
  <!-- your script-->
</div>


e.g.
<html><head></head>
<body>
<div data-role="page" id="areaformpage">
<div data-role="content">
    <div data-role="fieldcontain">
            <label for="textinput1">
                Title
            </label>
            <input name="" id="textinput1" placeholder="" value="" type="text">
        </div>
        <input data-role="button"  id="mybutton"  value="click me"/>
           
</div>
<script>
/* attach a submit handler to the form */
$("#mybutton").click(function(event) {
  alert("clicked");
  /* Send the data using post */
  $.post( "myphpfile.php", $("#addareaform").serialize() ).done(function( data ) {
    if (data=="success"){
      alert("Added successfully");
    } 
    else{
      alert(data);
    }
  });
});
</script>
</div>
</body>
</html>

Comments

Popular Posts