How to restrict the input of textbox based on regular expression?

I have two textbox named street address and pin code. I want to restrict the input in that textfield based on regular expression. For example : user cannot enter anything excepts digit in pincode and no special characters is allowed in street address. Thanks in advance.
2 answers


The mendix approach is to define validation rules for entities, that apply to the attribute that the user is entering in the text field. You can find these validation rules if you go to the properties for an entity in the domain model

Note that the validation will only take place after the user clicks a button to submit the form, meaning he can still enter anything in the text field.



PS: Here is guide by mendix on data validation -


Hi Kavya,


You can use the input mask for this:

The input mask limits what the user can enter in the text box. A ‘9’ means any digit, ‘Z’ means any letter, ‘U’ an upper-case letter, ‘L’ a lower-case letter and ‘*’ a letter or a digit. Other characters will be taken literally. For example, the input mask 99-LLL-9999 matches 24-apr-2008.


Hopes this help.