• Hi,

    Great plugin. The search is triggered only after I type something (though it works even after deleting that text). Can I trigger it just bu clicking on the textbox?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    Theoretically, it should be possible with some custom script code. Try copying this code to the functions.php in your theme (or child theme) directory:

    Please make sure to have a back-up of your site before making any direct changes on your server!

    add_filter('wp_footer', 'asl_trigger_input_click', 10);
    function asl_trigger_input_click() {
      ?>
      <script>
      jQuery(function($) {
        $('input.orig').on('click', function(e) {
          var _e = jQuery.Event("keyup");
          
          e.preventDefault();
          if ( $(this).val() == '' )
            $(this).val(' ');
          _e.keyCode = _e.which = 50;      
          if ( typeof window.event != 'undefined' )
            window.event = null;    
          $(this).trigger(_e);
        });
      });
      </script>
      <?php
    }

    This code will add an event handler for the input click, to trigger the search process.

Viewing 1 replies (of 1 total)
  • The topic ‘Trigger search on clicking on textbox’ is closed to new replies.