Is there a way to dynamically change the background color of an Edit field? the default is a lovely gold color, but we would like to vary this color for some fields as a way of highlighting the contents.
have a render snippet and have applied changes to the field.element.css background color but this is being overriden by .nx-field and dont seem to be able to change this.
thanks
Page 1 / 1
There two answers are helpful:
https://community.skuid.com/t/changing-the-color-of-text-from-field-in-edit-mode-via-css
https://community.skuid.com/t/change-field-color
By combining Glenn’s solution and taking Rob and Ben’s advice on css specificity I think you are probably just missing making your css a little more specific. For an edit field you need to add the input selector as the Skuid CSS background-color is applied at that level. The following render snippet and CSS works for me on an edit field:
var field = argumentsg0], value = skuid.utils.decodeHTML(argumentsg1]); <br>skuid.ui.fieldRenderersnfield.metadata.displaytype]afield.mode](field, value); <br>if (field.mode == 'edit' && value == 'ValueForRed') { <br> field.element.addClass("RedBackground");<br>}<br><br>.RedBackground input {<br> background-color: #F99;<br>}
Awesome, works perfectly!! thanks for your help!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.