Stripping Characters from Textbox Entries

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
James-S
Profound User
Posts: 61
Joined: Tue Jun 28, 2016 12:53 pm
First Name: James
Last Name: Sherwood
Company Name: Brunswick Boat Group
City: Knoxville
State / Province: Tennessee
Contact:

Stripping Characters from Textbox Entries

Post by James-S »

We have a user requirement which includes the use of barcode readers to do input into a textbox widget. The barcode reader adds a “tab” character at the end of the converted barcode data.

Questions:
  • Is there a way to strip the added “tab” character (eg. Javascript)?
  • After the input is stripped of the extra character, is there a way to set focus to another textbox widget? I know there is a focus property but the goal is to do all the barcode entry to multiple textbox’s and not return to the RPG program each time.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Stripping Characters from Textbox Entries

Post by Scott Klement »

Is there a way to strip the added “tab” character (eg. Javascript)?
Yes, you can retrieve the value of a textbox with the pui.get() API, and set it's value with the pui.set() API.

Code: Select all

var x = pui.get("the-id-of-the-textbox");
... code here to strip chars from x ...
pui.set("the-id-of-the-textbox", x);
After the input is stripped of the extra character, is there a way to set focus to another textbox widget? I know there is a focus property but the goal is to do all the barcode entry to multiple textbox’s and not return to the RPG program each time.

Code: Select all

getObj("the-new-textbox-id").focus();
James-S
Profound User
Posts: 61
Joined: Tue Jun 28, 2016 12:53 pm
First Name: James
Last Name: Sherwood
Company Name: Brunswick Boat Group
City: Knoxville
State / Province: Tennessee
Contact:

Re: Stripping Characters from Textbox Entries

Post by James-S »

Perfect. I knew these functions but just couldn't get my mind around using them in this context. Got caught up more in the requirements than focusing on what solutions are available.

Thank you Scott!
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests