Trigger SearchWidget search from another set of controls - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Trigger SearchWidget search from another set of controls

  • Trigger SearchWidget search from another set of controls
  • I'm trying to trigger the Search Widget from another set of controls I'm using for the mobile version of my Sitefinity site. I've been able to use jQuery to copy the value from the mobile textbox to the Search Widget's text box. But I'm having trouble triggering the submit button in the Search Widget.

    This is what the search widget looks like

    div id="m_nav_primary_ctl00">
        <fieldset id="m_nav_primary_ctl00_ctl00_ctl00_main" class="sfsearchBox">
        <input name="ctl00$m_nav_primary$ctl00$ctl00$ctl00$searchTextBox" type="text" id="m_nav_primary_ctl00_ctl00_ctl00_searchTextBox" class="sfsearchTxt">
        <input type="submit" name="ctl00$m_nav_primary$ctl00$ctl00$ctl00$searchButton" value="Search" onclick="return false;" id="m_nav_primary_ctl00_ctl00_ctl00_searchButton" class="sfsearchSubmit">

    This is what the mobile controls look like<div class="base"> 

    <div class="sfContentBlock"><
    input type="text" id="searchbox" name="search" size="40">
    <div class="base">
    <div class="sfContentBlock">
    <a href="#" id="search_btn">
    <img style="border-width: 0px; border-style: solid;" id="btn_search" src="/image/button_search.jpg" alt="Search">

    This is what my javascript looks like

    jQuery(function ()

        jQuery('#search_btn').click(function ()

  • Hi Raymond,

    Please check if the returned value of the search button is not an array. If so you could try to click() the button by:

    Svetoslav Manchev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items