Allow uppercase only in a field

Ken Ray kray at sonsothunder.com
Tue May 9 12:43:08 EDT 2006


On 5/9/06 2:08 AM, "Sarah Reichelt" <sarah.reichelt at gmail.com> wrote:

> Hi All,
> 
> I have a field where users can type, but I only allow some letters &
> symbols through and then I want them all to be uppercase, although I
> want to allow the users to be able to type in lower case.
> 
> I have the restricted characters working fine in a keyDown handler,
> and I have the field changing to upper case in the keyUp handler, but
> I still see the lower case letter briefly before it changes.
> 
> What I REALLY want is to change the keyDown parameter as I pass it.
> 
> Has anyone already solved this problem?

Try this:

on keyDown pKey
  put toUpper(pKey) into the selection
end keyDown

Seems to work here (althoug I haven't tested it completely),

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list