Advanced TextBox II

Get help using Construct 2

Post » Sat Feb 22, 2014 4:21 pm

Thanks to the help of some other users I keep on the develop of this little web aplication.
In fact is a kind of calculator. So, this step leads to reach a very special behaviour of a textBox. This time, it must act as an input of a range of numbers from 0 to 3. Only numbers!

So, I've developed this project (Here you can find the project capx)

https://www.dropbox.com/s/kqtb9atk3h4nat7/SingleNumber.capx

Here you can find an image:

https://www.dropbox.com/s/xpio3w28oi6uu2e/imagen.png


Do you know what to modify to make it act the way I want?
B
17
S
4
G
1
Posts: 105
Reputation: 1,874

Post » Sat Apr 26, 2014 4:55 pm

I'm not sure if you already fixed this. However I believe I found a solution to your problem. If you look in the manual at the System Expression, there are Regular Expressions available. Regular Expressions allow you to search for matches in a string/text according to a pattern that you define such as a range from 0 to 3. In Regex, this range pattern would look like this: "[0-3]". For more information on Regular Expressions, I would advise going to the Mozilla Developers Network Javascript Guide which provided an excellent tutorial section on Regular Expression. I've attached a modified version of your .capx that will now display a message to the user when they press a button. The message will tell them if they entered a correct character or not. Hope this helps.
You do not have the required permissions to view the files attached to this post.
B
9
S
2
G
1
Posts: 41
Reputation: 708

Post » Sun Apr 27, 2014 11:23 pm

Hey, I just seen it. I did not noticed the example before.
B
17
S
4
G
1
Posts: 105
Reputation: 1,874


Return to How do I....?

Who is online

Users browsing this forum: el3um4s, Ryan Kocourek, TylerJS and 11 guests