Thursday 3 November 2011

How to change "Specify your own value:" to Others in Custom List Form Sharepoint 2007

Sometimes we may need to change the text of Fill in choices field "Specify your own value to others":

This can be done with jQuery. Following are few quick steps to acheive this.


1) Open the Page in edit mode by appending &ToolPaneView=2 to the end of the URL

2) Insert a content editor web part

3) Insert the jQuery as the source (or a better practice is to put your jQuery in a text file stored in a document library and link to it in the CEWP).

4) Set the CEWP to hidden or chrome type to none so that it doesn't appear on the page.

The following script will find every instance of "Specify your own value" and replace it with the text "Others" if you drop it in your CEWP.

*note* I am referencing the jQuery library externally in this script, I highly recommend you download a local copy to a doc lib or your file system and reference it there.

















<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
 $("input[value='FillInButton']").each(function()
 {
 var inputID = $(this).attr("id");
 $("label[for='" + inputID + "']").html("Others");
 }
 );
})
</script>

2 comments: