title: Barcode reading values to textbox?
body: <p>I have a barcode scanner which reads the string of the barcode and displays in the active text box. also there is no consistent end character to the barcode, or standard length (I have 5 diffent length sizes. 16,17,18,19,20). I need to extract values from scanned data. so extracting values also depend on the barcode length. </p>
  
  <p>So how would I go about firing a method when the WHOLE string has been read in?</p>
  
  <p>Im using php and ajax to do this.</p>
  
  <pre><code>$(document).ready(function()
  {
  
  
  
      $("#bcode").focus();
      //prevents autocomplete in some browsers
      $("#bcode").attr('autocomplete', 'off').keyup(function(event)
      {
  
                  var name = $("#bcode").val();
  
  
  
              $("#status").empty();
              if(name.length &gt; 17 ) `// need to check all possible length values like this`
              {
                  selectAll();
  
                  $("#status").html('&lt;img align="absmiddle" src="images/loading.gif" /&gt; Checking availability...').show();
  
  
  
  
       $.ajax({
                      type: "POST",
                      url: "namecheck.php",
                      data : "bcode=" + name,
                      success: function(msg)
                      {
                          $("#status").html(msg).show();
                      }
                      });
  
          }
          else
          {
              $("#status").html('').addClass('err').show();
          }
      });
  });
  </code></pre>