This SharePoint tutorial, we will discuss, how to rename Save or Cancel button text in SharePoint 2013 list forms using JavaScript or jQuery. The same code we can use to rename Save or Cancel button text on SharePoint 2016/Online List Forms.
Here we are trying to rename Save to Submit and Cancel to Go Back through the script in SharePoint list form.
Rename SharePoint List Forms Save or Cancel button text using JavaScript
Below, is the JavaScript code to rename the SharePoint list form, Save and Cancel button which you can put in a script editor web part in the list forms.
Edit the newForm.aspx or editForm.aspx SharePoint list form and insert a script editor web part or content editor web part and then add the below code.
<script type="text/javascript">
function changeButtonText()
{
var inputs = document.getElementsByTagName("input");
for(i = 0; i<inputs.length; i++)
{
if(inputs[i].type == "button" && inputs[i].value == "Save")
{
inputs[i].value = "Submit";
}
if(inputs[i].type == "button" && inputs[i].value == "Cancel")
{
inputs[i].value = "Go Back";
}
}
}
_spBodyOnLoadFunctionNames.push("changeButtonText()");
</script>
Rename SharePoint List Forms Save or Cancel button text using jQuery
Below is the jQuery code to rename the SharePoint list form the Save or Cancel button using jQuery in SharePoint 2013/2016/Online.
Edit the newForm.aspx or editForm.aspx SharePoint list form and insert a script editor web part or content editor web part and then add the below code.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function()
{
$("input[value$='Save']").attr('value', "Submit");
$("input[value$='Cancel']").attr('value', "Go Back");
});
</script>
Now if you can see it will appear like below:
You may like following SharePoint tutorials:
- SharePoint modern list column formatting examples
- Hide SharePoint list columns based on user permissions
- Display SharePoint List items in a data table using Rest API and jQuery
- Add JSLink in Task List View in SharePoint Online
- Add heading in the default newForm.aspx in SharePoint list using JavaScript and CSS
- Change column ordering in list forms in SharePoint Online/2013/2016
- Different ways to create an auto-increment column in SharePoint 2013/2016/Online list
- QR CODE Generator in SharePoint using JavaScript
- How to show/hide columns based on the value of SharePoint radio button
- Hide content-type field in edit form in SharePoint Online/2013/2016
- How to display more than 3 views in SharePoint 2013/2016/Online list or document library
- Remove DIV tag from Multiline text field using ECMA in SharePoint
Here, we learned how to rename Save or Cancel button text on SharePoint 2013/2016/Online List Forms?
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com