Wednesday, October 14, 2009

Setting default search scope to This List

Scenario:
You want to set default search scope to This List.

Options:
#1. Either you can add a Content Editor Web Part to the page which the below script on the page where you need the search scope to be This List.

#2. Otherwise you can add it master page if you want this behavior through out you site.

Code:

<script type="text/javascript">
var a = document.getElementById('ctl00_PlaceHolderSearchArea_ctl01_SBScopesDDL');

a.options[0].selected = true ; </script>

0 comments: