I there We are making an app using barcode readers and it would be great if we did not have to hit enter or click each time an product is scanned, does anuybody has eny idea about how to achive this? Thanks in advance
I really don''t think you can do that inside Rails itself. But building the JS should be simple. You basically just have an onChange on the text input. And monitor the length of the text field. When it reaches the length of a barcode code you make it submit. I''ll be happy to give you an example if you are unsure on how to achieve that. On 5/21/06, Jorge Mario G. Mazo <vadersolo@gmail.com> wrote:> I there > We are making an app using barcode readers and it would be great if we > did not have to hit enter or click each time an product is scanned, > does anuybody has eny idea about how to achive this? > > Thanks in advance > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/
Also, Some barcode readers put carridge returns at the end of their transmission sequence. I used a barcode gun in a web application and it worked quite well. the only thing that was annoying was cursor focus but, again, javascript can *fix* it. Nathan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060521/e01c6d5e/attachment.html
Jorge Mario G. Mazo wrote:> I there > We are making an app using barcode readers and it would be great if we > did not have to hit enter or click each time an product is scanned, > does anuybody has eny idea about how to achive this? > > Thanks in advanceHi Jorge, we''re making a fulfillment app for cheap shipment in Europe. We''re planning to integrate barcode readers. Maybe we can share some ideas.. Our website is cebu.palmade.net . Thank you, Harm -- Posted via http://www.ruby-forum.com/.
Hi there guys well our bar code guns "seem" to be the cheapeast and they dont add a return at the end... so it seems like the JS solution is the only thing we can do for now so Mr. Jon Gretar Borgthorsson I would like to see that example, since I''ve been trying some things with JS, an example would be very apreciated Thanks in advance Jorge Mario G. Mazo
Hi there jon I just tried your example and it doesnt seem to work, it does nothing pretty much about the onKeyUp I dont know what it does. The bar code readers (the ones we have) all the do is ty emulate a keyboard you scan and a text is passed to the app, like if you were typing on the keyboard nomally Thanks again On 5/23/06, Jon Gretar Borgthorsson <jon.borgthorsson@gmail.com> wrote:> Sure. > > Here is a basic example to get you started. This is tha bare basics > and the simplest method of doing this. Might not work for your needs > but then we will just try again. > > ############### Code Starts ############### > <html><head> > <script type="text/javascript" language="javascript" > > function check_barcode () > { > if (document.bar_form.barcode.value.length == 4) document.bar_form.submit(); > } > </script> > </head><body> > <form action="/controller/submitaction" method="get" id="bar_form"> > <input type="text" name="barcode" id="barcode" onKeyUp="check_barcode();" /> > <p><input type="submit" value="Continue →" /></p> > </form></body> > </html> > ############### Code Ends ############### > > I decided to but this up in basic HTML fromat instead of setting up a > Rails example so it''s better for you to get the idea and to set up > into your own workflow. > > I am unsure however if barcodes would register a onKeyUp. I don''t know > if barcode simulate a keyboard or not. Let me know if they don''t. In > this example I set up to submit on 13 letters. > >