Hello Jessica,
Please try with below CSS
/* white background when editable */
.bordered-selector
{ border: 2px solid black;
border-radius: 4px;
padding: 5px;
background-color: white;
}
/* for read-only */
.bordered-selector:read-only
{
background-color: #f0f0f0;
color: #888;
}
Hi Jessica,
There should be a default class from Mendix for editable and non editable Textfields, Boxes, Areas etc.
You can set the editable condition here :
If the condition is true, then the Textfield is white - Otherwise greyed out.
If you still prefer a custom solution then you can try the css classe from above.
Just go to Properties -> Dynamic classes of the field. There you can create the Expression and add the class ( if editable = true then 'bordered-selector:read-only' else 'bordered-selector')
Hope this Helps,
Hi Jessica,
You can target below classes to get the desired results which you want.
to keep editable textboxes solid white
input.form-control:not([disabled]):not([readonly])
{
background-color: #ffffff !important;
}
to maintain grey for disabled fields
input.form-control[disabled],input.form-control[readonly]
{
background-color: #f0f0f0 !important; cursor: not-allowed;
}
Hope this helps!
Thanks