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?

1 Answer 1


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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.