View Full Version : Question Inputfield - Set Focus
hi,
i have 4 inputfields in which the user enters a serialnumber. i set the input mask, so the user can only enter 4 digits in each field.
is it possible to set the focus on the next inputfield after the 4th digit is entered?
byte
Use String.Length in the On Key event to see if the length is == 4, if so Page.SetFocus to the next object
hi Worm,
thanks for the answer. this is what i got.
RegInputSerial1 = Input.GetText("Input_Serial1");
StrLength1 = String.Length(RegInputSerial1);
if StrLength1 == 4 then
Page.SetFocus("Input_Serial2");
end
but it is not working, with a input mask, only if the inputfield is a standard field.
byte
Give this a try
--trim out your place holder
RegInputSerial1 = String.TrimRight(Input.GetText("Input_Serial1"), " ");
StrLength1 = String.Length(RegInputSerial1);
if StrLength1 == 4 then
Page.SetFocus("Input_Serial2");
end
kind of works, but if i move the mouse over the inputfields, all numbers disapear.
byte
This seems to work for me. Maybe I missed something in my explanation, or I missed something in yours in how you wanted it to work.
in your example it works fine, but even if i copy your code into my project, it still deletes the number if i move the mouse over the inputfields.
byte
When you move the mouse over the object, or click in it?
Do you have any other code or objects below with On Enter code?
when i move the mouse over the object
i have 2 buttons below. one of them sends the information to a php script and the other one exits the programm.
byte
There must be some code somewhere with a On Enter or the Page's Mouse events that is doing it. If you can't find it, you can post the app
i cant't find anything
here is the app. maybe you can find out why it is not working.
byte
That's odd. Works fine here. Are you running the latest rev of AMS?
yes i do.
but if it can't be fixed, i just leave it without the input mask
byte
I don't know what to say, your app does work fine on my system here. There must be something else involved.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.