• I’m looking for a way to include a page specific search function.

    There is a page on our website with a large number of different buttons that link to different companies we work with. While these are alphabetized, we want to include a search function that will let a user enter a company name and have it highlighted on the page. We don’t need to it search for anything outside of that particular page.

    Is there a plugin that can achieve this or is there a simple method I’m overlooking, as the search functionality provided in the page editor does not seem to be capable of this.

    • This topic was modified 2 years, 6 months ago by Jan Dembowski.
Viewing 3 replies - 1 through 3 (of 3 total)
  • That’s the work of the browser: every browser supports CTRL/CMD + F to search on the current page.

    • This reply was modified 2 years, 6 months ago by George Appiah. Reason: Added screenshot
    Thread Starter sirprizes

    (@sirprizes)

    Thank you, George.

    We’re, of course, aware of the CTRL + F option. We’d prefer to have an option on the page for the ease of use for our users.

    We’re mostly just exploring options and seeing if a good one exists. If not, yeah, CRTL + F it is.

    Hi sirprizes,
    you can trigger find function with JavaScript too.

    1. Create Input Field
    <input type="text" id="searchterm" placeholder="Enter value...">

    2. Copy/Paste Js function into your scripts

    function findTerm() {
    	var searchField = document.getElementById("searchterm");
    	if (searchField.value != null) {
    		window.find(searchField.value);
    	}
    }

    3. Call Function
    You can call the function if someone changes the input field or by clicking a button. onclick or onchange

    <input type="text" id="searchterm" placeholder="Enter value..." onchange="findTerm()">
    <button onclick="findTerm()" class="button">Find</button>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Single Page Search’ is closed to new replies.