.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

SharePoint Custom List Field Colour set background colour using jQuery

Posted By:Sagar Pardeshi       Posted Date: March 31, 2014    Points: 200    Category: SharePoint    URL: http://www.dotnetspark.com  

SharePoint Custom List Field Colour set background colour using jQuery


In this article we explore SharePoint custom list field dropdown their different colour option for example see below scenarios:

It has a field called "Status', this filed has a drop down list Contains Red, Green and Yellow.
If you select Red then background should become Red
If you select Green then background should become Green 
If you select Yellow then background should become Yellow

Let's Proceed

Edit the All items List page in the browser and add a Content Editor Web part, modify the web part and show the Source Editor to add the following code:

<script language="javascript" src="/JS/jquery-1.9.0.min.js" type="text/javascript"></script><script language="javascript" type="text/javascript">
  var colr="";
$("select[title$='Color']").change(function () { 
  colr=$("select[Title=' Status ']").val();
<!--[if !supportLineBreakNewLine]-->

After adding jQuery click apply and ok. Save page.


See the final result ..

Summary :

We explore to  displaying background SharePoint custom list field drop down color in display we  can use this script.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend