|
-
[F8] Input text field to 'submit' on 2nd return?
Hello there.
I've looked and looked for a solution to this and ALMOST got it working, but it's not behaving reliably enough.
I've got an input text field that I want to limit to 2 lines. I've set Selection.focus to the text field so you can just start typing when the field appears. If you press enter, you jump down to the second line (in the same field). If you press enter again, you 'submit' your text. This all works as intended - unless you click on the text field before typing. If you do that, when you hit enter the FIRST time it submits the text.
Currently I'm counting the occurences of '\r' using indexof and submitting the text if the count is 2 or greater. Why it submits after 1 return, I do not know.
Is there a more elegant way to just 'get' the number of lines (rows) in an input text field (in AS2)?
If so, cheers in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|