Missing Field Behavior Properties

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Missing Field Behavior Properties

Post by townsend » Fri Jun 17, 2011 7:43 pm

I can't seem to find a couple of common field behavior properties.

The Text Entry Field defaults to multi-line.
How do I set text fields as single line?

At this point I'm thinking I have to place code in each field with a
on returnInField ... end returnInField routine, then escape out
with a send or dispatch command. Is there a simpler way?

Also, is there a password property where asterisks are replaced for letters?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Missing Field Behavior Properties

Post by Mark » Fri Jun 17, 2011 11:52 pm

Hi,

This is sufficient to disable return and enter:

Code: Select all

on returnInField
end returnInField
on enterInField
end enterInField
You might want to take care of pasted text as well. E.g. show an error if the clipboardData["text"] contains cr and don't allow the text to be pasted.

I have a password library on my website. Just scroll down a little.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Missing Field Behavior Properties

Post by SparkOut » Sat Jun 18, 2011 1:45 am

It may or may not be sufficient for your needs, but also check the "autoTab" property. If the autoTab of a field is set to true, then hitting the return key will move the focus to the next field, as if the tab key navigation had been done.

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Missing Field Behavior Properties

Post by townsend » Mon Jun 20, 2011 5:04 pm

Thanks Mark!! I learned a lot from you Password routine.

Plus-- I download lots of other good code examples from your website,
Free and Shareware Products for Developers
This is a great find-- for any LiveCode developer.

Also, good tip SparkOut-- now I know what that autoTab property is.

Post Reply