How do I test min/max textbox characters

Get help using Construct 2

Post » Thu Aug 04, 2016 8:49 pm

Right now i can hit the save button without typing anything and that will take me to the next layout.

I know how to set character length. But how do i test if a user has entered the min/max characters before enabling the save button that will take the player to the next layout?


Thanks for any help
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Thu Aug 04, 2016 8:58 pm

Textbox On Text Changed
System - Is between values
Min>len(Textbox.Text)>Max - Set Button Enabled
Else - Set Button Disabled
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Thu Aug 04, 2016 11:37 pm

oosyrag wrote:Textbox On Text Changed
System - Is between values
Min>len(Textbox.Text)>Max - Set Button Enabled
Else - Set Button Disabled



Thank you for the reply.

where do i put the "Min>len(Textbox.Text)>Max - Set Button Enabled"?
On the System - is between two values, there's -

Value
Lower Bound
Upper Bound.

It won't let me put it in any of the boxes.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Fri Aug 05, 2016 12:16 am

value - len(textbox.text)

Lower Bound - whatever your minimum is
Upper Bound - whatever your maximum is
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Fri Aug 05, 2016 12:34 am

Thank you oosyrag.

You are awesome.

I didn't use the 'Else' since i disable the Group 'Touch Save' on start up. Works perfectly. Thank you for your patience and helping me with this.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Fri Aug 05, 2016 1:14 am

Actually I added that in for the case where the user is typing and goes past the max and you want to disable the button again.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303


Return to How do I....?

Who is online

Users browsing this forum: FlyingRam, jkmalau, marcinkowski and 10 guests