Question

I have a edit form of a task list, i am using the content type "Workflow Task (Sharepoint 2013)", it has 2 buttons, one for Approve and other for Deny.

I need to change the color of the Approve and Deny buttons, i have tried with Sharepoint Designer (Doesn't allow me to edit the form, even if I have full control permissions) and i have tried with Content Editor as well using below code inside a script tag:

  function changeColors () {
    documento.getElementById("Status_c15b34c3-ce7d-490a-b133-3f4de8801b76_$DropDownChoice_Aprobado").style.backgroundColor = "green";
  }
  
  document.onload= changeColors();
 

But, it doesn't work until I fire the event in the developer console.

Can someone help me?

Was it helpful?

Solution

1.Create new txt file and add this code (put your color code)

<style>
#Status_c15b34c3-ce7d-490a-b133-3f4de8801b76_\$DropDownChoice_Approved {
    background-color: greenyellow;
}
#Status_c15b34c3-ce7d-490a-b133-3f4de8801b76_\$DropDownChoice_Rejected {
    background-color: red;
}
</style>

2.Save file as for ex buttonColor.txt

3.Upload file to SiteAssets (site/SiteAssets/Forms/AllItems.aspx)

4.Add content editor webpart on editform.aspx (edit page add webpart).

Edit content webpart properties > link txt file from siteassets to webpart /SiteAssets/buttonColor.txt

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top