This project has moved and is read-only. For the latest updates, please go here.

Attach css ?

Sep 11, 2014 at 4:12 PM
Any way to add css for the field that is read only by using existing script?
Sep 22, 2014 at 7:03 PM
The read only label has a class which you can use to apply styles: .sputility-readonly.
Jun 30, 2015 at 5:08 PM
Hi, same topic:

Is there any way to use this library just to highlight data field in edit/ display/ new form? Not make them read. Just to add background color or any other css.

Looks like there are no other options to highlights and looks like this library works so well with all SP 2013 forms (incl. multiline rich text boxes)
Jun 30, 2015 at 5:23 PM
You can do this indirectly using SPUtility... mostly jQuery is what you want. Each field has a controls property with is a reference to the span element containing all the controls:

var myField = SPUtility.GetSPField('My Generic Field');
$(myField.Controls).css( "color", "red" );

You could also use jQuery to attached a CSS class if you want to share styles across multiple fields.