Support Forums

Auto-Tab to next text box after input

Archived support forum for customers who once purchased a PrimalForms product license. This forum is locked.
User avatar
graves
Posts: 8
Joined: Tue Feb 26, 2013 5:23 am

Auto-Tab to next text box after input

Postby graves » Tue Feb 26, 2013 5:23 am

Hello,

I want to build a small form used to collect three barcodes from a handheld scanner to three separate fields. Is there any way to auto-tab to the next field after scanning a barcode so the user doesn't have to manually tab to the next field before scanning again? In the mean time I designed it so that all the data is scanned into a rich text box in a specific order, the data get's stored to a variable and split by `n`r where a for loop counts through every three strings and creates a log file with the data. However, I'm just not happy with this from a end user perspective as three separate labeled fields would be more intuitive.

Thanks
User avatar
Alexander Riedel
Posts: 5866
Joined: Tue May 29, 2007 4:43 pm

Auto-Tab to next text box after input

Postby Alexander Riedel » Tue Feb 26, 2013 5:31 am

Use the .Focus() member of whatever control object you want to have the input focus after processing the change event from the previous input.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
graves
Posts: 8
Joined: Tue Feb 26, 2013 5:23 am

Auto-Tab to next text box after input

Postby graves » Tue Feb 26, 2013 8:14 am

Thanks, Alexander! Works perfectly.

$txtBoxA
$txtBoxB

$handler_txtBoxA_TextChanged=
{
if ($txtBoxA.Text.Length -ge 7)
{
$txtBoxB.Focus()
}
}
User avatar
graves
Posts: 8
Joined: Tue Feb 26, 2013 5:23 am

Auto-Tab to next text box after input

Postby graves » Wed Feb 27, 2013 5:03 am

One question though - what if I don't know the length of the field? The problem I'm running up against is obviously if $txtBoxA.Text.Length is greater than 7, the cursor is jumping to the next field after 7 characters are entered.

This field is used to collect hard drive serial numbers and the length varies quite often amongst different manufacturers and models.

Any suggestions?

Thanks in advance.
User avatar
davidc
Posts: 4459
Joined: Thu Aug 18, 2011 4:56 am

Auto-Tab to next text box after input

Postby davidc » Wed Feb 27, 2013 6:01 am

If the length is unknown they you should not change the focus on the control and let the user decide.

I recommend setting the tab order of the controls, so when the user presses the 'Tab' key, it will jump to the next field. The tab order button is located:

Ribbon->Home->Designer

Once you press the tab order button, simply click on the controls and it will set the tab index in the order of your clicks.

David
David
SAPIEN Technologies, Inc.
User avatar
graves
Posts: 8
Joined: Tue Feb 26, 2013 5:23 am

Auto-Tab to next text box after input

Postby graves » Wed Feb 27, 2013 6:32 am

Thanks for your reply but the only problem with that is the user may or may not be near a keyboard as they are using a wireless handheld scanner and are often not near the workstation.

I really hope I don't have to abandon this layout for my previous one.

Thanks,
Jason
User avatar
davidc
Posts: 4459
Joined: Thu Aug 18, 2011 4:56 am

Auto-Tab to next text box after input

Postby davidc » Wed Feb 27, 2013 8:18 am

So the user isn't typing the value in? Can't you just focus the control after inserting the value? I guess I'm not clear on what is happening here.

David
David
SAPIEN Technologies, Inc.
User avatar
graves
Posts: 8
Joined: Tue Feb 26, 2013 5:23 am

Auto-Tab to next text box after input

Postby graves » Wed Feb 27, 2013 9:18 am

Seems I might be missing something very basic here. I would like to simply focus the control after the user scans the data but I don't know how without using a TextChanged event on the control and if the length of the string is not consistent then TextChanged does me no good.

The process should go like:

-user scans data to field 1.
-focus automatically changes to field 2.
-user scans data to field 2
-focus changes to field 3
-user scans data to field 3
-the submit button automatically is pressed (will probably hide the submit button control)
-data from all three fields is stored to separate variables and a log is created with the data
-all fields are cleared and focus is reset to field 1.

I have this all working using TextChanged but not without a huge drawback of not always knowing the string length.

Thanks,
Jason
User avatar
davidc
Posts: 4459
Joined: Thu Aug 18, 2011 4:56 am

Auto-Tab to next text box after input

Postby davidc » Wed Feb 27, 2013 9:52 am

You don't have to use the TextChanged event if your script is inserting the text. It is hard to tell what you are doing without looking at the script.

This really is going beyond the scope of this product forum. I recommend posting the question in the Windows PowerShell forum and include a sample form.

David
David
SAPIEN Technologies, Inc.

Return to “PrimalForms”

Who is online

Users browsing this forum: No registered users and 4 guests