Quantcast
Channel: SharePoint Diary
Viewing all articles
Browse latest Browse all 1058

Change "Save" or "OK" Button Text on SharePoint List Forms

$
0
0
Wouldn't it be more meaningful to rename SharePoint List NewForm.aspx "Save" or "OK" button text to "Submit" in Request Tracking Lists?

Yes! Sure, I'll possible to change "Save" button's text to something else which gives more meaningful in the context.

Using jQuery to Rename "Save" button Text:
Place the below jQuery script in a text file, Upload it to a document library, add a CEWP to the NewForm.aspx page, and specify the "Content Link" in Content Editor Web Part's Property Pane.

<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");
     });</script>
Result in action: SharePoint 2010 change save button text
sharepoint 2010 change save button text

Using JavaScript to Set SharePoint save button text:
Open the NewForm.aspx in browser, Append: ?toolpaneview=2 , (E.g. http://sharepoint.crescent.com/sharepointsupport/lists/URLChangeRequests/NewForm.aspx?toolpaneview=2) You will get the page in edit mode. Now, add the CEWP below List View Web part and place the below code:

<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("changeOKBtnTxt()");

function changeOKBtnTxt()
{
//Get all Input Elements on the page
var inputs = document.getElementsByTagName("input");

//Get the "OK" button
for(i = 0; i<inputs.length; i++)
 {
    if(inputs[i].type == "button" && inputs[i].value == "OK")
     {
      //Change the "OK" button's Text to "Submit"
      inputs[i].value = "Submit";
     } 
  }

}
</script>
sharepoint 2007 change ok button text
Its also possible to do it with SharePoint Designer. You have to hide the Default OK button and add custom buttons as explained in this post: Redirect Users to Thank You page from NewForm.aspx after form submission

Viewing all articles
Browse latest Browse all 1058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>