×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

Set 'Title & Keywords only' search checkbox as the default

Unanswered Question
Nov 17th, 2011
User Badges:

There are four places where the 'Title and Keywords only ' checkbox  appears.
1 - Home page
2 - Category page
3 - Search results  page
4 - Order on behalf of page

To select the checkbox by  default, add the following JavaScript to the footer file.

<script type="text/javascript">

if (document.getElementById('searchservice')) {

document.searchservice.searchOnlyTitlesAndKeywords.checked  = true;

}

if  (document.getElementById('edit_requisition_form')) {

document.edit_requisition_form.searchOnlyTitlesAndKeywords.checked  = true;

}

</script>



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
David Klimas - ... Thu, 11/17/2011 - 17:49
User Badges:

The second if statement in the previous comment was causing a  JavaScript error on the Order on behalf of page.  The modified code is  below.  Add the JavaScript to your footer file.



if  (document.getElementById("searchservice")) {
document.searchservice.searchOnlyTitlesAndKeywords.checked  = true;
}
if (document.getElementById("edit_requisition_form")  &&  document.getElementsByName("searchOnlyTitlesAndKeywords").length > 0)  {
document.edit_requisition_form.searchOnlyTitlesAndKeywords.checked  = true;
}


Actions

This Discussion

Related Content