473,549 Members | 2,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scanning bar code <GS> into web form

4 New Member
I have a problem using a bar code scanner into a text area.

I found on this forum someone with the same problem as me, except he thought the javascript wasn't finding the <GS> character \1D.
http://bytes.com/groups/javascript/9...rm-input-field

The problem is, the scanner isn't scanning it into the text area. Yet it does scan into Text Pad and when cutting and pasting it into the text area, javascript does find it.
Just can't scan it directly into the text area.
I have tried changing the META TAG and the form parameters in the html.
If Paul Jørstad is there is would like to know how he solved the problem.
Thanks, Pam.
Apr 22 '09 #1
8 5441
Delerna
1,134 Recognized Expert Top Contributor
Browsers automatically remove certain characers from html content.
For example, if you send "Hello world" with 20 spaces inbetween the two words into a <textarea> from script and then read back the contents of the <textarea>, the result would be

"Hello World" with only 1 space. The other 19 were removed by the browser when the script added it.

However, if you do the same thing into an <input type='text'> then you get back what was put in.
Have you tried using an <input> instead of a <textarea>?
Apr 23 '09 #2
pinkskink
4 New Member
Hi Delerna, but i just tried the input and that too, did not have the character when i scanned directly to it.
And when i scan to text pad, the character is there, and when i paste into the input the javascript finds it.
Thanks, Pam.
Apr 23 '09 #3
acoder
16,027 Recognized Expert Moderator MVP
Perhaps you need to check the character encoding on the page.
Apr 25 '09 #4
pinkskink
4 New Member
Any suggestions? I have tried
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
also
<textarea name='txt1' id='txt1' rows="10" cols="120" accept-charset="UTF-8"
also
<form id="form1" name="form1" accept-charset="UTF-8"
Apr 27 '09 #5
acoder
16,027 Recognized Expert Moderator MVP
Perhaps you could try a different browser or scanner and see if that makes a difference.
Apr 28 '09 #6
Delerna
1,134 Recognized Expert Top Contributor
My limited experience with barcode scanners showed they generally send a sequence of characters as though they were entered directly from the keyboard, is that what yours is doing?

How are you getting the entry from the input/textarea?

I'm thinking that if you use the onkeydown event of the
<input type=text onkeydown="OnKe ydownEventOccur ed()">
that the event might get called for each individual character sent from the scanner and you might get all the characters that way.

test the theory with something like this
Expand|Select|Wrap|Line Numbers
  1. function OnKeydownEventOccured()
  2. {   alert(window.event.keyCode);
  3. }
  4.  
You may already be doing something like this. If so ignore my post :)

Good luck, there must be some logical explanation for this, just have to find it.


Incidentally, I think that copy paste of the sequence from notepad might put the whole string into the input/textarea in one hit as opposed to 1 character at a time when entered directly from the scanner. Perhaps this is why the character is dropped when entered from the scanner and not when it is entered from a paste operation?
Apr 28 '09 #7
pinkskink
4 New Member
Hi Delerna, using your function, i was able to concatenate all the chars and ascii values together. And it seems there is a character there but not the GS. it is ascii 17 and 221.
It was suggested to look for any non numeric character so I did that, but after the form is submitted they disappear. So I may have to do something client side.
May 6 '09 #8
Delerna
1,134 Recognized Expert Top Contributor
sounds like a plan.........
May 6 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

8
4919
by: nyso | last post by:
Hi, being not very good at php regular expression, could anyone help me giving the regular expression for : - an e-mail address, - a website address (including sub-domain if possible). many thanks in advance, -- nyso
4
5637
by: Paul Jørstad | last post by:
Hello! In a form I have an input field. It's supposed to get input form a scanning device. Thus, the input might contain special characters (like the Group Separator in a EAN barcode). Now, I want to manipulate a little with the input in a javascript, but I'm not able to find the Group Separator: input = document.main.input.value; var a...
3
1472
by: Martin | last post by:
Hi Guys, I am a bit of a JavaScript rookie, so please bear with me .... Some time ago, I asked for help with some code to populate a drop down country box based on a value I was returning from a popup menu. This is all now working fine (Thanks !) but I have noticed, it unfortunately does not scale well, and is causing quite some delay ...
8
1951
by: Sam Halliday | last post by:
i want to have a function which can print the printable form (possibly a 2 character string) of a character on UNIX like systems. for example, if i were to pass the ascii value '\3', i would like it printed "^C". there is a file called charset.c in the distribution of less ftp://ftp.gnu.org/gnu/less/less-382.tar.gz] which achieves this, but...
0
2051
by: John | last post by:
Hi I have this problem on winxp/offixexp machine but not on win2k/office2k machines. I have a main form which has a panel which has a child form. The child form opens a dialog form. When the dialog form is closed using the 'x' button or using me.close in code, the app crashes. The source the error is pointed as my main app loop;...
1
5163
by: gary.bernstein | last post by:
Any idea why line 57 fails? http://rafb.net/p/86JdGg61.html gs = MyShutdown<Component, T1, T2, T3>(this); Errors: shutdown1.cpp: In constructor `Component<T1, T2, T3>::Component(int)': shutdown1.cpp:46: error: type/value mismatch at argument 1 in template parameter list for `template<template<class T1, class T2, class T3> class...
3
5253
by: Magesh | last post by:
How date-time attributes of a file are represented in the structure "struct stat"? Coz as I noted they found to be unsigned integers and I donno how they are interpreted as date & time in the members st_atime, st_mtime, and st_ctime. I don't want any lib fun that returns the corresponding time formatted string coz what I want to know is the...
4
1388
by: GS | last post by:
in Windows form, I have Datagridview and detailview with the same binding data manager. upon clicking the + in the navigator, the primary key field is blank as expected, but I need to enable it for new record to let user to fill it. On the other hand I don't want to allow change to the field for existing record. so disable that on existing...
7
2099
by: creative1 | last post by:
I am trying form valdiation with javascript but it never call the function. can someone please test this code and see why it is like that. It screwed up my mind. here is my code: <!-- Java Script form form validation and entries --> <script language="JavaScript"> function checkForm() { alert("I am called"); var cfirstname, cemail, cpass,...
0
7558
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7484
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7755
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7515
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5400
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1089
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
798
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.