Text entry field, limit characters and script? [solved]

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Location: Virginia, USA
Contact:

Text entry field, limit characters and script? [solved]

Post by trenatos » Sun Jul 07, 2013 11:05 pm

So I'm messing with my chat application, and I'm trying to figure out how I can 1. limit the text in the text box. 2. Trigger a script when the user hits the Enter key. 3. Use the tab key to move from the text box to the send key.

I tried messing with the tab order (Layer order) but all it tabs between are two text fields.
A text entry field and a scrolling field, it does not want to tab to buttons.
Last edited by trenatos on Mon Jul 08, 2013 4:31 am, edited 1 time in total.
Marcus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6190
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Text entry field, limit characters and executuing script

Post by dunbarx » Mon Jul 08, 2013 3:41 am

Hi.

Look up the "tabKey"message and the "enterInField" message in the dictionary. Should be easy with a few experiments.

When you say limit the text, what exactly do you mean? To one line? To a certain string length? To certain characters only?

Write back...


Craig Newman

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Location: Virginia, USA
Contact:

Re: Text entry field, limit characters and executuing script

Post by trenatos » Mon Jul 08, 2013 4:30 am

I just found the answer to the enter thing, indeed enterInField and returnInField solved the issue.

Limiting the fields to x characters, which I also found the answer to, a simple script for onKeyDown that counts the characters in the field, if under the limit the pass.

:)
Marcus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”