Auto tab to next field

Mark Smith mark at maseurope.net
Wed Mar 15 13:11:40 EST 2006


Jeff, this should work:

on keyDown theKey
   if the number of chars in me >= 3 then
     put theKey into fld "ProvOfficePhone2"
     focus on fld "ProvOfficePhone2"
     exit keyDown
   else
     pass keyDown
   end if
end keyDown

replace <focus on fld "ProvOfficePhone2"> with
<select after fld "ProvOfficePhone2"> if you want to keep typing in  
the newly focused fld.

Cheers,

Mark

On 15 Mar 2006, at 17:55, Jeff Honken wrote:

> I trying to program an automatic tab to the next field after the user
> inputs three characters.  Here's the code I'm using:
>
> on keyDown theKey
>   if the number of chars in me >= 3 then
>     focus on fld ProvOfficePhone2
>     exit keyDown
>   else
>     pass keyDown
>   end if
> end keyDown
>
> The above code works but when I hit the fourth character it tabs to  
> the
> next field but it loses the character that was typed. i.e. if you type
> 1234 the 123 goes into my first box and the cursor goes to the next
> field but it doesn't input 4 into that field.  Any suggestions?  Jeff
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the Use-livecode mailing list