RSS

How to change choice field “allow fill-in choice” default text ‘Specify your own value:’ to custom text?

21 Jul

  • Open default.master (found in the _catalogs\masterpages folder) in SharePoint Designer. 
  • Before the </HEAD> end tag I added the following js code:

<script type=”text/javascript”>
 function changeSpecifyOwnValue() {

  var node_list = document.getElementsByTagName(‘input’);
   
  for (var i = 0; i < node_list.length; i++) {
      var node = node_list[i ];  // NOTE: there is a space here after the i, if not a lightbulb was added… delete this
    
      if (((node.getAttribute(‘type’) == ‘radio’) && (node.getAttribute(‘value’) != ‘DropDownButton’)) || (node.getAttribute(‘type’) == ‘checkbox’)) {
          if (node.nextSibling.innerHTML==”Specify your own value:”) {
           node.nextSibling.innerHTML = “Other:”;
          }
      }
  }    

 }
</script>

After this I added the function above to be executed in the body onload, below is the sample usgae:

<BODY scroll=”yes” onload=”javascript:if (typeof(_spBodyOnLoadWrapper) != ‘undefined’) _spBodyOnLoadWrapper(); changeSpecifyOwnValue();”>

Advertisements
 

4 responses to “How to change choice field “allow fill-in choice” default text ‘Specify your own value:’ to custom text?

  1. Sam Allgood

    March 19, 2010 at 11:04 PM

    Thanks for providing this solution. I did have to change the quotes and apostrophes to get it to work … probably something with the copy/paste codes that were used for those.

     
  2. Shawn Whitmore

    June 17, 2011 at 5:48 AM

    Sam,
    Can you show what quotes and aostrophes you had to change to get it to work. I can’t seem to figure it out. — Shawn

     
    • Jim Mathew

      June 17, 2011 at 12:47 PM

      Shawn,

      Copy the code to notepad and replace all “DOUBLE QUOTES & SINGLE QUOTES” to make it work. by default if you copy directly quotes changes to unsupported format.

      Rgdz,

      Jim

       
  3. Shawn Whitmore

    June 18, 2011 at 11:46 AM

    Jim,
    That did the trick, thanks much for the quick answer! — Shawn

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: