how to assign a class name to a created text field in mendix?

I have created one text field where I have to assign a class name for it, when I am double clicking on text field in modular its showing me a dialogue box, there we have class option. If I am giving there its assigning to its div not directly to text box.   How it is possible??
2 answers

Hi Amresh,


This is intended behavior by Mendix. the "text field" in the modeler should not be read as an actual input field but as a widget. Every widget in Mendix is usually a <div> wrapper around visual elements (like in your case, an <input> textbox).


If you want to manipulate specific elements inside a widget you will have to change the stylesheet based on this setup, e.g.

.yourclass input {

     display: "none";




Hi Amresh,

This is working as intended. If you want to specifically target your input field, you will have to create a class yourself. I am not sure how familiar you are with SASS (this Mendix7 how-to is a good start, shows which programs you need and such:, also helpful is this blogpost:, but you can easily create a class that lets you alter the (for instance) input field, which would look like:

.testClass {
        color: red;

Hope this is enough information to help you on your way!


EDIT: I see I took too long typing this answer, Joost's answer is of course correct as well. I'll leave my post here, as it contains some information to get you started :)