Solved

Keeping control characters in inputbox

Posted on 2006-11-27
5
196 Views
Last Modified: 2010-04-06
Problem:
We have a barcode scanner, running Windows CE 4.01. When our web page requests a scan, we can aim the scanner at a barcode, pull the trigger, and the code is automatically entered into the input field by going through the clipboard. However, the barcode contains some non-displayable control codes (ASCII &h1D and &h1E) as field separators. These are stripped out when the data hits the inputbox. I know the codes are there, because the test program for the scanner will display them as small squares in the text. I know the page itself will handle the codes, because I can cut and paste a dummy record into the input and the control codes appear as small squares.
Question: How do I get the control codes to copy in with the rest of the barcode?
0
Comment
Question by:SCHale
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18021472
Try

<html>
<head>
<script>
saveVal=""
function show() {
  var val = document.forms[0].barcode_entry.value
  if (val !=saveVal) {
    document.getElementById('showDiv').innerHTML='<xm'+'p>'+escape(val)+'</xmp>';
  }
}
</script>
</head>
<body onLoad="setInterval('show()',200)">
<form>
<input type="text" name="barcode_entry" value="">
</form>
<div id="showDiv"></div>
</body>
</html>
0
 

Author Comment

by:SCHale
ID: 18033381
Thanks for replying. Today is Tuesday. I won't be able to test this until tomorrow or Thursday, but I think I understand what you are trying to do here.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18035289
I just need to see if the field really contains the data or if the barcode software or something strips them before they hit the field
0
 

Author Comment

by:SCHale
ID: 18098770
I know the scanner reads the control codes, because the test program will show the characters as squares in its textbox display. This also indicates that, since the test software uses the same method of acquiring the data as the web page (through the clipboard), the control code are also in the clipboard. Somehow they are being lost in transit from the clipboard to the web page.
As usual, my priorities have been rearranged. Other matters have reared their ugly heads and I won't be able to test this for several weeks.
So thank you for your response. Although we haven't resolved this problem, I now have a way to test the actual content. So, as far as I'm concerned, you've earned the points.
Once this has been resolved (I'll take a hammer to it if I have to), I'll post the results here.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 18100163
Yes, please do
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question