3

Can 'Save' button text be changed to 'Submit' on SharePoint List forms -SharePoint Online

enter image description here

2

You do not need to load a 90 Kilobyte jQuery library or loop thru elements

standard JavaScript * contains Selector:

document.querySelector("a[id*='Commit'] span:nth-child(2)").innerHTML='Submit';

Or shorter and changing only one button on screen

document.querySelectorAll("a[id*='Commit']")[1].innerHTML='Submit';

And to add script to the Form: Hide top navigation links in displayform, editform Sharepoint 2007

0

I have done it this way, you could add this script to your master page...

var x = document.getElementsByClassName("ms-cui-ctl-largelabel"); //The save button class
var i = 0;
while (i<x.length)
{
    if (x[i].innerHTML=="Save")
    x[i].innerHTML = "Submit";
    i++;
}

Of course it's not the best option since they can change the class name in the future or something else, but it works right now.

0

I usually use jQuery and the attribute starts with selector, they'll probably not change the ID's.

$("id^='Ribbon.ListForm.Edit.Commit.Publish']").children("span:eq(1)").text("Submit");

I haven't looked much into the SP.Ribbon namespace tbh, so from what I can see you'll probably have to do something in the lines of this:

SP.Ribbon.PageManager.get_instance()
    .get_ribbon()
    .getChild("Ribbon.ListForm.Edit")
    .getChild("Ribbon.ListForm.Edit.Commit")
    .getChild("Ribbon.ListForm.Edit.Commit-LargeLarge")
    .getChild("Ribbon.ListForm.Edit.Commit-LargeLarge-0")
    .getChild("Ribbon.ListForm.Edit.Commit-LargeLarge-0-0")
    .getChild("Ribbon.ListForm.Edit.Commit.Publish-Large0")
    .$N_1.$G_1.children[1].innerText = "Submit";

I just hope thats not the correct way to use the SP.Ribbon namespace to alter existing elements, just hope someone has a better solution.

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.