Textbox Jump

Moderator: Rathinagiri

Post Reply
rmtarget
Posts: 67
Joined: Sat Jul 04, 2009 7:28 pm

Textbox Jump

Post 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.
De antemano muchas gracias y saludos !!
Atte.
Rene Mtz. (méxico city)
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: Textbox Jump

Post by CalScot »

Have you tried using:

Set Confirm OFF?

It certainly works with numerics, but I think it works with text, too.
CalScot
rmtarget
Posts: 67
Joined: Sat Jul 04, 2009 7:28 pm

Re: Textbox Jump

Post 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' .....
De antemano muchas gracias y saludos !!
Atte.
Rene Mtz. (méxico city)
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Textbox Jump

Post 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.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Textbox Jump

Post 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...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: Textbox Jump

Post 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
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Textbox Jump

Post 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

East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
CalScot
Posts: 303
Joined: Thu Mar 21, 2013 12:22 am
Location: California

Re: Textbox Jump

Post by CalScot »

Ah, that works perfectly - Thank you!
CalScot
rmtarget
Posts: 67
Joined: Sat Jul 04, 2009 7:28 pm

Re: Textbox Jump

Post by rmtarget »

Thank you very much you guys, 'On Change' seems to be the proper solution. Greetings
De antemano muchas gracias y saludos !!
Atte.
Rene Mtz. (méxico city)
Post Reply