PassMark Logo
Home » Forum


No announcement yet.

Customizing .NET search form with special JS script

  • Filter
  • Time
  • Show
Clear All
new posts

  • Customizing .NET search form with special JS script

    We have used Zoom Search v6 (with JS search) successfully for years to document our product help. Being a company with a lot of search categories, I developed a bit of JavaScript code to collapse the search categories to show more of the results from the search page.

    We've recently needed to implement the .NET search to benefit from the speed and power of the server-side search, but have been searching for a way to include the HTML necessary to run the JS collapsing code with the categories list. Is it possible to have the .NET version of the search create and output custom HTML code in addition to the search?

  • #2
    There's a few approaches to consider.

    First, note that the categories generated by the server control in HTML is wrapped in a span tag with class="zoom_categories" within the form class="zoom_searchform". So your JavaScript placed on the search.aspx page should be able to access this element from the DOM and hide or show it, without changing the HTML of the search form.

    This would allow you to keep the search form with all the functionality such as remembering the settings of the last user submitted search.

    Another approach is to disable the search form generated by the server control all together ("Configure"->"Search Page"->"Search form"->"Do not generate"). Then you can script your own search form in HTML as you require on the search.aspx page. You will also have to parse in the properties from the URL (e.g. "search.aspx?zoom_query=hello&zoom_per_page=10&zoo m_cat[]=1", etc.) if you wish to retain the ability for the form to have the current entered values -- otherwise it'll be blank on each new page load.
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine


    • #3
      Thanks, Ray!