I wanted to use custom style class for dhtmlxForm item, My use case is, we have a custom style for disabled / readonly items, which is available as different style class, I wanted to append this custom style class to those elements (textinput, select etc) which are disabled.
Please let me know how to add / append custom style class names to each form items.
I have seen this template type earlier, but this is a complete customization, My application uses a dynamic form generated based on some metadata from database, so if the user make a change in DB settings same will get reflected in the Form in UI, so it will be difficult for me to customize each item using a ‘template’ type and corresponding method. Also my requirement is ONLY to add a custom style class, I do not have any intention to change the complete item,
eg,
{type:“input”, name: ‘name’, label:‘Login’}
I just wanted to append a style class to this element when rendered in HTML. I tried ‘className’ attribute here, but it didn’t work.
In general, input has such attribute, and it should work. docs.dhtmlx.com/doku.php?id=dhtm … form_input
An example of a code and result look below:
.dhxform_obj_dhx_terrace .greenLab div.dhxform_label { color: #006400 !important }
Thank you very much it worked, is it possible to apply generic and dynamic style, eg, I wanted to make the element border in red color if the validation failed. It can be applied to any element like input, select, checkbox, textarea etc. and should get applied conditionally at run-time. Validation could be fired on “blur” or “form submit”, which should mark all invalid input elements in red thin border.
Is it possible to get the “input” DOM element, some thing like ,form.getItem("") or form.getElement(""), some method like this which can give me the DOM element so that I can apply a different style after the validation.