Hello Karthikeyan C,
In mendix you can use different kinds of validation, you can add validation rules or you can create your validation with a micro- or nanoflow.
For validating on certain text characters or other special characters you can probably use a regular expression.
Please take also a look at this learning path it goes in depth into the different validation tactics:
https://academy.mendix.com/link/modules/95/Ensuring-your-Data-is-Valid-and-Consistent
Hope this helps
Good luck!
If you're using native Mendix components for input, you don't have to worry about this type of injection, because they're always escaped so the scripts won't be executed.
If you use other components that allow direct access to your database, or make use of components that render things that the user typed (such as OQL or rich text), you do have to worry about sanitation. From the same page:
So you can use those to strip any malicious code from non-native Mendix components.