how to pass whole data using ajax in php using keypress event -


i passing empcode using key press event, whole empcode not transfered , last digit cut.

here code:

$(document).ready(function(){         $("#e_code").keypress(function(){              //var datastring=document.getelementbyid("e_code").value;             var datastring = 'e_code='+ $(this).val();             $.ajax({              type: "post",              url: "getdata.php",              data: datastring,              cache: false,              success: function (html) {             $('#details').html(html);             $('#custtrnhistory').show()           }        });     });      });    on getdata file code 

write code in keyup instead of keypress

$("#e_code").keyup(function(){ 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -