473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Scanning bar code <GS> into web form

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 5402
Delerna
1,134 Expert 1GB
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
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 Expert Mod 8TB
Perhaps you need to check the character encoding on the page.
Apr 25 '09 #4
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 Expert Mod 8TB
Perhaps you could try a different browser or scanner and see if that makes a difference.
Apr 28 '09 #6
Delerna
1,134 Expert 1GB
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="OnKeydownEventOccured()">
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
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 Expert 1GB
sounds like a plan.........
May 6 '09 #9

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

Similar topics

8
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...
4
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...
3
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...
8
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...
0
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...
1
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)':...
3
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...
4
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...
7
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.