How to limit field to one line?

J. Landman Gay jacque at hyperactivesw.com
Wed Nov 2 13:01:08 EST 2005


Garrett R. Hylltun wrote:
> Greetings,
> 
> Can anyone explain to me how to limit a field to only one line, and to intercept the return key from within that field?

Besides the returnInField handler that others have mentioned, you can 
also limit the amount of text without any scripting at all. Just set the 
height of the field so that only one line is showing, and then set the 
field's autoTab property to true. Whenever the user hits the return key, 
the selection will automatically move to the next field. You can control 
how many lines a field will accept by simply sizing its height to 
accomodate the number of lines you want to allow.

This does not trap the return key though. For that, you'd need the 
returnInField handler.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list