title: Typing to hidden input field
body: <p>I have a special type of problem on my hands, for which i would like some suggestions from ppl who might have implemented something similiar. </p>
  
  <p>I have a client using EAM scanners to scan barcodes, coupled to mobile units by Bluetooth as a keyboard unit. </p>
  
  <p>On said mobile units we have a web framework running with JQuery Mobile/HTML5. They would like to use the scanners with this. The thing we want to achieve is to have the scanner pick up a barcode to an invisible field of some sort, then this would be used to enable a previously disabled collapsible in the UI depending on what value was scanned. </p>
  
  <p>I have performed tests on using a text field and triggering the keyup-event, to keep checking as each character is passed, if the value entered corresponds to a data attribute on the collapsible. This appears to work fine. </p>
  
  <p>But i don't want the user to see the input field (it should be completely hidden) but it still needs focus and to be able to accept keypresses. If i set visibility:none in styles it no longer trigger the keyup events. </p>
  
  <p>So, how can i create an input field that is not visible in the UI but can be set to be in focus by code, and will accept text to trigger the keyup? </p>
  
  <p>I tried input type="hidden" as well but that seems to not accept input or focus. </p>
  
  <p>My testcode: </p>
  
  <pre><code>     $(document).ready(function() { 
            $( '#f1' ).collapsible("disable");
            $( '#f1' ).trigger("create");
            $( '#f2' ).collapsible("disable");
            $( '#f2' ).trigger("create");
            var value = ""; //Store entered information
        //Add key handler, to the div including the text field, to avoid other text 
        //  field being blocked out
      $( "#page_wrapper" ).keypress(function(event) {
       //Translate key to char and append 
  
  
       value += String.fromCharCode(event.which);
  
       /*
        * Cut out
        */
  
  
       //Iteration here to check all collapsibles if the data value entered is valid for   
       //one of them, after checking 
       //input lenght, to make sure it is a complete EAN barcode 
  
       //Make sure to clear to limit input
       $( "#scanfield" ).val("");
  
  
  
          //Focusing on the field
          $( '#scanfield' ).focus(); /* CUT */
  </code></pre>