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

转自:http://sharepointjim.wordpress.com/2009/07/21/how-to-change-choice-field-allow-fill-in-choice-default-text-specify-your-own-value-to-custom-text/

 

  • 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();”>

 

 

posted on 2010-01-05 16:50  王丹小筑  阅读(431)  评论(0编辑  收藏  举报

导航