Jim Mathew's Sharepoint Blog (MOSS Techie from Abu Dhabi)

March 22, 2009

How to change sharepoint button text on runtime?

Filed under: Sharepoint Controls, Sharepoint Designer, User interface — Tags: — Jim Mathew @ 8:35 AM

Did you ever tried to change the text of sharepoint button using sharepoint designer. for eg: i had a requirement to change the “FINISH” to “SUBMIT” of Survey dataview webpart….i have tried to update directly from sharepoint designer but was a failure…..finally i got the below code …

try this….
Open your page in sharepoint designer. checkout the requiredd page and paste below code… and update your text…

<script>
var x=document.getElementsByTagName(“input”);
for (var i=0;i<x.length;i++)
  {
  if (x.item(i).type==”button”&&x.item(i).value==”Finish”)
     {x.item(i).value = “Submit”};
  }
</script>

Blog at WordPress.com.