Change field text color for required fields

  • 1
  • Question
  • Updated 3 years ago
  • Answered
In a Field Editor I want all the required fields to be red. Can someone let me know how I would go about achieving this?
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Louis Skelton

Louis Skelton

  • 4,878 Points 4k badge 2x thumb
Hi Tami,

If it's the field label colour that you would like to change, you can go about it by creating an "in-line" javascript resource (not snippet) and pasting in this:

(function(skuid){
	var $ = skuid.$;
	$(document.body).one('pageload',function(){
	    // Sets label to red
		$(".required").css("color", "red");
	});
})(skuid);

The important bit is in bold.

Not sure if this is best practice but works for me!

Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
Perfect! Thank you so much Louis.