Limit number of chars in a field

Alex Rice alex at mindlube.com
Mon Nov 10 14:24:00 EST 2003


On Nov 10, 2003, at 12:08 PM, Bojsza wrote:

> I can't the field property that I can select for limiting the number 
> of characters a user may enter into a field. I have fields that I want 
> to allow up to but not exceeding 11 characters.
>
> I have opened other example scripts but they all allow more characters 
> than what the field can show?
>
> Any suggestions?

There is no property like that. Add something like this to the field's 
script:

on rawKeyDown
   if (the length of me) > 11 then exit rawKeyDown
   pass rawKeyDown
end rawKeydown

(untested script)

Alex Rice <alex at mindlube.com> | Mindlube Software | 
<http://mindlube.com>

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco



More information about the use-livecode mailing list