Page 1 of 1

Textbox Jump

Posted: Tue Jul 09, 2013 8:06 pm
by rmtarget
Hi Friends: I need to capture five numbers of two digits each, I already have the screen capture but I want to know if it's possible to automatically jump to the next field once I entered the first number (of two digits so the field is full) and so on...now I have to jump to the next field with the tab key in order to enter the next number.

Hola Amigos: Necesito capturar cinco números de dos digitos cada uno, ya tengo la pantalla de captura pero quiero saber si es posible 'brincar' automáticamente al siguiente campo, una vez que ya capture uno (una vez que llene el campo con los dos digitos) y asi sucesivamente; como ahora lo hago es: capturo el número (el cursor se queda ahi en ese campo) y tengo que pasarme al siguiente campo con la tecla tabulador del teclado.

Mil gracias y salduos cordiales desde méxico city
[u]Moderator Notes[/u] (Pablo César) wrote:Topic moved from Main HMG General Help.

Re: Textbox Jump

Posted: Tue Jul 09, 2013 9:12 pm
by CalScot
Have you tried using:

Set Confirm OFF?

It certainly works with numerics, but I think it works with text, too.
CalScot

Re: Textbox Jump

Posted: Tue Jul 09, 2013 11:37 pm
by rmtarget
Hi CalScot, thanks, and yes I have the 'Set Confirm Off' but it seems don't work, these are my textboxes:

@60,40 TEXTBOX TEX1 WIDTH 25 ;
VALUE a1 ; //Local a1:=0
NUMERIC ;
INPUTMASK '99'

@85,40 TEXTBOX TEX2 WIDTH 25 ;
VALUE a2 ;
NUMERIC ;
INPUTMASK '99' .....

Re: Textbox Jump

Posted: Tue Jul 09, 2013 11:59 pm
by Pablo César
rmtarget wrote:Necesito capturar cinco números de dos digitos cada uno, ya tengo la pantalla de captura pero quiero saber si es posible 'brincar' automáticamente al siguiente campo, una vez que ya capture uno (una vez que llene el campo con los dos digitos) y asi sucesivamente; como ahora lo hago es: capturo el número (el cursor se queda ahi en ese campo) y tengo que pasarme al siguiente campo con la tecla tabulador del teclado.
No entendi todavia. Llegué a pensar que seria em modo console. Puedes explicarnos que es lo que deseas del programa, si es posible coloque el código fuente, asi podremos entender mejor lo que quieres.

---

I did not understand yet. I thought that would em console mode. Can you explain what you want the program, if possible post your source code, so we can better understand what you want.

Textbox Jump

Posted: Wed Jul 10, 2013 12:06 am
by Pablo César
Si entendi bien, creo que deseas trabajar con lo que se escribe en los TextBoxes, es eso ?

Para eso tiene que adicionar a algun de los eventos como: ON CHANGE <tu_funcion> o ON ENTER <tu_funcion> y en tu funcion lees las propiedades del Value de cada TextBox y procesalos como te convengan. Pero tendrías que darnos más detalles de lo que quieres hacer...

--

If I understood well, I think you want to work with what is written in the TextBoxes, is it?

That has to add to some of the events as: ON CHANGE <your_function> or ON ENTER <your_function> and in your function read the Value property of each TextBox and procesalos as you agree. But you should give us more details of what you want to do...

Re: Textbox Jump

Posted: Wed Jul 10, 2013 1:28 am
by CalScot
I've tried several basic things (MaxLength = 2, etc.) -- all of which I'm sure you've tried -- but none of which work; everything I've tried still requires that you press tab to get to the next textbox after entering the two digits, instead of just jumping to it after the 2nd digit is entered.

Instead of having five separate textboxes, could you do it in just one textbox with an input mask like "99-99-99-99-99", then parse out the data from that? I know that's not an ideal answer, but it will work - unless or until someone comes up with the real solution!

Regards,
CalScot

Re: Textbox Jump

Posted: Wed Jul 10, 2013 3:06 am
by Rathinagiri
You have to write in 'On Change' event a function to move the focus to the next textbox as Pablo suggested.

Now consider this:

Code: Select all


@60,40 TEXTBOX TEX1 WIDTH 25 ;
VALUE a1 ; //Local a1:=0
NUMERIC ;
INPUTMASK '99';
ONCHANGE tex1changed()

@85,40 TEXTBOX TEX2 WIDTH 25 ;
VALUE a2 ;
NUMERIC ;
INPUTMASK '99'
....


function tex1changed
   if len( alltrim( str( form1.tex1.value ) ) ) == 2
      form1.tex2.setfocus()
   endif
return nil


Re: Textbox Jump

Posted: Wed Jul 10, 2013 3:52 am
by CalScot
Ah, that works perfectly - Thank you!
CalScot

Re: Textbox Jump

Posted: Wed Jul 10, 2013 12:50 pm
by rmtarget
Thank you very much you guys, 'On Change' seems to be the proper solution. Greetings