How to block symbols

Chat about anything not covered in these forums, but keep it civil!

Post » Sat Jun 11, 2016 4:02 pm

How to block symbols for example:
1)Russian letters
2)[email protected]#$%^&*()_+
3)And how to make limit for simbols (like when you registering on site)
B
5
Posts: 10
Reputation: 249

Post » Sat Jun 11, 2016 6:03 pm

Instead of checking if it's a symbol you don't want, just check if it's a symbol you want. Do it under the "on text changed" condition, and the length can be truncated there too.

Code: Select all
global text allowed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

+-------------------------------------------+
| textbox: on text changed                  |
+-------------------------------------------+
    local text filtered = ""
    +---------------------------------------+
    | system: repeat 8 times                | system: add mid(TextBox.Text,loopindex,1) to filtered
    |System: find(allowed,                  |
    |  mid(TextBox.Text,loopindex,1)) <> -1 |
    +---------------------------------------+
    +---------------------------------------+
    |                                       | textbox: set text to filtered
    +---------------------------------------+
B
92
S
32
G
110
Posts: 5,295
Reputation: 71,501


Return to Open Topic

Who is online

Users browsing this forum: hhhhhhhh11111111 and 3 guests