Hi guys ,
In this GUIDE we will be learning how to restrict some letters like special
characters in the Text-box.
First, we will be using an extension called TaifunText-Box by Taifun.
Because there is no event block called “OnTextChanged” listener block in
Niotron and so I request Developers to add this block in the upcoming update.
What is Text-Box?
You can go to this link to understand what is a Text-Box
Link - https://builder.niotron.com/reference/components/userinterface.html#TextBox
Here I have done a simple design with three components, they’re : -
- TaifunText-Box extension
- Text-Box - Taken for restricting some letters/symbols/anything.
- TaifunText-box - For using “OnTextChanged” event block.
- Notifier - A notifier to show alert message if user enters any special characters.
There are some ways to follow to block special characters, we will learn them one by one.
Fist we will initialize all the special charters or any charters which you don’t want user to enter in a Tet-box in a list of a variable.
When the screen initialize, we will start a TextChangedListner for the textbox which you want to block any characters from TaifunText-Box extension.
We will take a event block called AfterTextChanged from Taifun extension.
First we will check if the last word of the Text-box text, if the segment is in the list of the variable then we will remove that last letter of the Text-box and show alert message that “Please do not include any special characters”.
- A request to Niotron developers to add on AfterTextChanged event block.
- Hope you enjoyed and learnt something new in this topic!
- Feel free to contact me via Email - [email protected] or you can
just PM me.
- Any suggestions or improvement to this topic will be appreciated, you can just say me, I’ll update it.
Email me - [email protected] or PM me.