Having hint text in textbox

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
Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Having hint text in textbox

Post by Tribblehunter » Fri Dec 13, 2013 9:06 pm

Hi all.
experimenting with app for mobile.
I have a series of text boxes for user input.
I wish to display in them the type of thing I want the user to put in them.
IE name, age, etc etc.
Is there an easy way to do this, or do I have to pre-fill the boxes with hint text (greyed out for example) in script,

Have been doing this in app inventor sucessfully, but unsure with Livecode.

Thanks

Brian
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10332
Joined: Wed May 06, 2009 2:28 pm

Re: Having hint text in textbox

Post by dunbarx » Fri Dec 13, 2013 9:46 pm

Hi.

Users are accustomed to grayed text as a hint. Pre-filling is easy. You would change the "foreGroundColor" of the field text from gray to black whenever anyone types into the field, and of course lose the hint text.

Are you OK with implementing this in LC?

Craig Newman

Tribblehunter
Posts: 78
Joined: Wed Apr 10, 2013 9:08 pm

Re: Having hint text in textbox

Post by Tribblehunter » Sat Dec 14, 2013 8:17 pm

Hi Craig, and thanks for the confirmation of what I thought.

Yes I can soon learn how to implement this. Just working on paper plans at moment so will take a week or so before I start playing with code.

Then comes the hard part... lol

Brian
Returning to try to learn livecode again.

But much greyer at the temples than the last time.

FLCo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 36
Joined: Thu Jul 27, 2006 5:40 am
Contact:

Re: Having hint text in textbox

Post by FLCo » Sat Dec 21, 2013 10:48 am

FieldFormatter can do this for you automatically...

Code: Select all

set the DefaultText of fld 1 to "Search..."
See http://livecode.com/store/marketplace/fieldformatter

Hugh Senior
The Flexible Learning Company
• ChartMaker: www.FlexibleLearning.com/chartmaker
• ControlManager: www.FlexibleLearning.com/controlmanager
• The Scripter's Scrapbook: www.FlexibleLearning.com/ssbk
• DatePicker: www.FlexibleLearning.com/datepicker

Post Reply