Okay
  Public Ticket #3100375
How to trigger the Search field
Closed

Comments

  •  6
    Ali started the conversation

    Hi. 

    Is there a way/link to trigger the search form to open from an icon/text on the screen. I basically want to mimic the header search button elsewhere on the page.

    Thanks

  •  1,919
    Judith replied

    Hi Ali,

    Thanks for keeping in touch.

    I am not sure I understand your query.

    I see the search icons on every page opening the same. Please let me know whether I am missing something:

    9338325208.png

    Thanks.

  •  6
    Ali replied

    Hi, yep the search function and header button works perfectly well. I would also like to use another button (on the sticky bar at the bottom) on the page to call the form. Hope that makes sense.

  •  8,939
    Tahir replied

    Hey Again,

    Try adding an ID "search-btn" to a button element and check. 

    Thanks


    ThemeNectar Support Team 

  •  6
    Ali replied

    Hey Tahir, unfortunately that didn't work. FYI this is what I'm adding to a textbox:

    <h6 style="text-align: center;">[icon color="extra-color-3" animation_speed="slow" size="regular" icon_size="" animation_delay="" image="icon-salient-search"]
    <a id="search-btn" class="open-search" href="#searchbox"><span style="color: #f2f2f2;">Explore</span></a></h6>

    I have also tried adding "search-btn" to the Element ID in the Text Box Settings.

  •  8,939
    Tahir replied

    Please add an ID to a div above the "a" tag and check.

    Thanks


    ThemeNectar Support Team 

  •  6
    Ali replied

    That worked! Thank you as always :)

  •  11
    Gengler replied

    Hey Tahir,

    i just used this to rebuild the same functionality on my site but i recognized that the search is only opening once and you then have to reload the page. Any idea?

  •  8,939
    Tahir replied

    @Gengler,

    Please provide the page url so that i can write up the custom css for whats possible.

    Thanks


    ThemeNectar Support Team 

  •  11
  •  8,939
    Tahir replied

    Hey Again,

    Try using the Same HTML code as the Header Icon like below.

    <li id="search-btn"><div><a href="#searchbox" class=""><span class="icon-salient-search" aria-hidden="true"></span><span class="screen-reader-text">search</span></a></div> </li>4

    Thanks 


    ThemeNectar Support Team 

  •  11
    Gengler replied

    Sorry, but no effect. Still just working once.

  •  8,939
    Tahir replied

    @Gengler ,

    Please create a new ticket so we can login and check on this.

    Thanks


    ThemeNectar Support Team 

  •  8,939
    Tahir replied

    Also add the "#searchbox" to the "href" and not ID : 

    2041378508.pngClick on Image to View Larger

    Thanks 


    ThemeNectar Support Team 

  •  8,939
    Tahir replied

    Hey Again,

    An Additional JS code would also have to be added to remove the class "open-search" from the div:

    <script type="text/javascript">
    jQuery( document ).ready(function() {
    jQuery('body').on('click', '#ajax-content-wrap', function (e) {
     jQuery('#search-btn a').removeClass('open-search');
     });
    });
    </script>
    

    Thanks


    ThemeNectar Support Team