javascript - Simulating a click to submit a form in jQuery -


alright have text field have bar code scanned said text field. search database , return information in form of submit button. using code simulate click on submit button.

if($.browser.msie){ //simulate click on button     $("#search").keyup(function (e) {         if(e.keycode == 13) {           $('input:submit').click();         }      }); } 

the problem code takes of keystrokes , clicks button many times. submit represent data gets written database, if bar code abc123 action 6 times, need once. how fix this? code works in ff , chrome, not ie, 1 need work in. grrr hate ie much!

why need "click" submit button? why don't submit form like:

$("#search").blur(function(){    document.myform.submit(); }); 

your barcode reader you.


Comments