0

I have a problem. I need to catch changes in input text form and refresh result div, but when I entering "12" I see result for "1", when I entering "123" I see result for "12". What to do?

 var securityID = genSecurityID();

 $(document).on('keypress', '#poisk', function () {
     //$(document).on('change', '#poisk', function(){
     var poisk_val = $(this).val();
     //alert(poisk_val);
     //$('#poisk').keydown(function(){ 
     //$(this).keydown(function(){ 
     var data1 = {
         'search': poisk_val,
         '_': securityID
     };
     AjaxResultat(data1, 'search', '.search_res', '?view=live_search');
     //alert(poisk_val);
     //});
 });

1 Answers1

2

Handle a keyup event instead of a keypress.

AstroCB
  • 12,337
  • 20
  • 57
  • 73
Dejo
  • 2,078
  • 3
  • 26
  • 38