Solved

Keeping control characters in inputbox

Posted on 2006-11-27
5
194 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
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do you troubleshoot Javascript conflicts on a Bootstrap webpage? 3 469
Technology stack suggestions 4 68
Form submit issue 11 89
Animated .jpg? 13 104
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

749 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