Skip to main content
Nintex Community Menu Bar
Question

Change background color of an Edit field


Forum|alt.badge.img+1

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

Translate
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+5

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 = arguments[0], value = skuid.utils.decodeHTML(arguments[1]);&nbsp;<br>skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field, value);&nbsp;<br>if (field.mode == 'edit' &amp;&amp; value == 'ValueForRed') {&nbsp;<br>&nbsp; &nbsp; field.element.addClass("RedBackground");<br>}<br><br>.RedBackground input {<br>&nbsp; &nbsp; background-color: #F99;<br>}
Translate

Forum|alt.badge.img+1

Awesome, works perfectly!!  thanks for your help!

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings