PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Change background colour of required fields?

  1. Is there a way to change colour of the input for required fields?

    For some reason, some people don't seem to see the asterisk, so I figured making the actual input a pastelly reddish colour if it is required.

    Posted 12 years ago on Saturday May 21, 2011 | Permalink
  2. You can do this with a minor customization. You would need to detect the list items that contain the "gfield_required" span and then use jQuery to add another class to that. Once you've added the class, you can use CSS inheritance to add additional styles to the inputs.

    Here's the code: http://pastie.org/1934701

    You would add that to your header.php file just before the </ head> tag. That's also assuming that your theme has already loaded the jQuery library.

    Here's a screenshot of my test: http://grab.by/aboU

    Hope that helps out.

    Posted 12 years ago on Saturday May 21, 2011 | Permalink
  3. Thanks, that's great. I'll have a play.

    Posted 12 years ago on Saturday May 21, 2011 | Permalink