How do I (Character limit - TextArea)

Get help using Construct 2

Post » Sun Nov 16, 2014 5:23 pm

Hello guys , a textarea , you can determine how many characters can contain ?
Example : I would like in a textarea the user could only enter 20 characters , is it possible?
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Sun Nov 16, 2014 6:54 pm

CAN anyone help ?
B
11
S
3
G
1
Posts: 105
Reputation: 1,135

Post » Sun Nov 16, 2014 6:57 pm

B
32
S
7
G
4
Posts: 400
Reputation: 4,595

Post » Sun Nov 16, 2014 6:58 pm

Check the length of the text in the text box, and truncate it if over 20. Example:

Code: Select all
Compare two values: len(TextBox.Text) > 20          TextBox Set text to left(TextBox.Text, 20)

left(s, x) returns a string containing x characters starting from the left side of the string s.

EDIT: Ah, got beaten to it, but there it is.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 36 guests