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.
Text entry field, limit characters and script? [solved]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Text entry field, limit characters and script? [solved]
Last edited by trenatos on Mon Jul 08, 2013 4:31 am, edited 1 time in total.
Marcus
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Text entry field, limit characters and executuing script
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
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
Re: Text entry field, limit characters and executuing script
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.
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