Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock Inputbox

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
0
0
US
Hi All,

I have a simple script which uses an inputbox to prompt the user for a lot number. The inputbox is populated using a barcode scanner when they scan a barcode on their documentation. What I want to do is prevent them from changing that scanned value or manually entering one.

Can you please advise on how I could do this.

Nick

Mighty
 
Not sure. Although, (brainstorm) you could accomplish this if there was a way to append a carriage return to the scanned barcode before it populated the input box. Or, you could disable the keyboard.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Is it easy to disable the keyboard?

Mighty
 
Relatively. As the following post suggests, you will need to download and register the AutoIT dll. After that, it's only a couple of lines.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Assuming that the barcode scanner operates as a 'keyboard emulator' this may have unintended consequences. I went through a similar issue with a card-swipe reader. Appending a carriage return after the read didn't help either as that only works if a read occurs and does not prevent users from typing in the box without using the scanner.

Short answer, if the scanner is indeed a 'keyboard emulator' there is probably no way to do what you want short of physically disconnecting the keyboard and hiding it in the janitor's closet. (Users never look in the janitor's closet.)
 
Oh and by 'unintended consequences' I meant of course that it would disable the scanner as well as the keyboard.
 
Perhaps an easier way would be to use an HTML inputbox, effectively you would be creating a mini HTA application. Worth considering maybe?


In order to understand recursion, you must first understand recursion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top