Wednesday, July 7, 2010

Remove search scopes from Search scopes Dropdown list using JQuery.

Easy to remove Search scopes from Out Of the Box Search Scope Drop down list using JQuery.
Use below JQuery for remove Scopes from Dropdown list.

$(document).ready(function(){
$(window).error(function(){
alert("Error");
});

$("select[id$='SBScopesDDL'] option:contains('Scope2')").remove();
$("select[id$='SBScopesDDL'] option:contains('This Site:')").remove();
});

2 comments:

  1. Where do I copy this code to?
    Is there a Javascript header I aadd to this code?
    Could you please update this code, so users are able to copy and paste it into their master page or css file?
    Thanks

    ReplyDelete
  2. Brad,
    Copy this code in master page OR Page layouts etc.
    where you want to remove the scope from drop down.
    Also you have to register latest Jquery library.

    Feel free to ask me..
    Thanks,

    ReplyDelete