How to limit the input in the TextBox?

Get help using Construct 2

Post » Fri Aug 24, 2012 2:10 pm

Hello, does anybody knows how to limit the string or number input in the TextBox?

(eg. Permit only the user to input two numbers maximum)

I am also attaching a couple of images, since in Firefox the TextBox doesn't show some arrow controls on the right side. But in Google Chrome it does. Does this has to do with CSS styling?

Anybody knows how to remove it, or the style options to do so?

Firefox


Google Chrome
B
12
S
2
G
5
Posts: 17
Reputation: 3,564

Post » Fri Aug 24, 2012 3:17 pm

first of all set textbox type to "text" NOT "textarea". text is single line, textarea is multiline - that's why you see these arrows.

if you do this and arrows don't disappear you have to add css style overflow:hidden or overflow:auto

as for the limit you can to id with events with compare two values system condition:
[code]len(TextBox.Text) > 2
-> TextBox set text to left(TextBox.Text,2)
[/code]
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Fri Aug 24, 2012 5:17 pm

Thank you for your answer ranma, trying it out.
B
12
S
2
G
5
Posts: 17
Reputation: 3,564


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests