Text box entery

Éric Chatonet eric.chatonet at wanadoo.fr
Sat Jan 29 08:46:33 EST 2005


Le 29 janv. 05, ˆ 04:29, Paul Salyers <ps1 at softseven.org> a Žcrit :

> However now I need to learn how to input characters in a text box, this
> text box will always 6 characters alpha-numerals then after the 6th
> characters is typed in I want it to auto continue (pressing of the 
> enter
> key) without the user doing anything.
>
> NO non alpha-numerals will be used. This is not a password so blocking 
> the
> characters from showing is not needed.

In the script of your field:

on rawKeyDown pKey
   switch
   case the number of chars of me = 6
     enterKey -- Æ
     break
   case pKey = 65288 -- delete key
   case (pKey >= 65429) and (pKey <= 65438) -- numbers
   case (pKey >= 65456) and (pKey <= 65465) -- numbers with shiftKey
   case (pKey >= 65) and (pKey <= 90) -- lower case
   case (pKey >= 97) and (pKey <= 122) -- upper case
     pass rawKeyDown
     break
   default
     beep
   end switch
end rawKeyDown
------------------------------------
on enterKey
   -- your statements
end enterKey

Hope this helps,
Amicalement,

ƒric Chatonet
24, Boulevard de Port-Royal
75005 Paris


More information about the use-livecode mailing list