• Resolved lpalmeida

    (@lpalmeida)


    Hello,

    I would like to set a name on the input without writing on the input and get the result.

    Example:
    HTML
    ————————————————————————————

    <div class="main-search-form"><?php echo do_shortcode('[wpdreams_ajaxsearchlite]'); ?></div>
                  <div class="main-sugeestion">
                      <h2>Our suggestions:</h2>
                  <ul class="suggestions">
                    <li><a href="#" class="pointerin">Outsystems</a></li> 
                      
                      <li><a href="#" class="pointerin">Business Consulting</a></li>  
                      <li><a href="#" class="pointerin">Banking</a></li>  
                      <li><a href="#" class="pointerin">Insurance</a></li>  
                      <li><a href="#" class="pointerin">PSD2</a></li> 
                       <li><a href="#" class="pointerin">GDPR</a></li>
                       <li><a href="#" class="pointerin">Talent</a></li>
                      <li><a href="#" class="pointerin">M-Files</a></li>
                       <li><a href="#" class="pointerin">DocDigitizer</a></li>
                       <li><a href="#" class="pointerin">Solutions</a></li>
                       <li><a href="#" class="pointerin">DMM</a></li>
                      
                      </ul>
                  
                  </div>

    jQuery
    —————————————————-

        $('.pointerin').on('mouseup', function() {
            $(".orig").val($(this).html());
        });

    So, i have a few suggestions names and when i click on the name appears on the input…so far is OK…but the problem is not getting any results…not give any action.

    How can I achieve this?

    Thanks in advance
    lpalmeida

    • This topic was modified 5 years, 9 months ago by lpalmeida.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi lpalmeida,

    This is almost perfect, all you need to do is to trigger the input event, otherwise it only changes the appearance, but nothing else. Just change this line, to:

    $(".orig").val($(this).html()).trigger('input');

    ..and that’s it. This should do the trick.

    Best regards,
    Ernest M.

    Thread Starter lpalmeida

    (@lpalmeida)

    Hello Ernest M.

    It works like a charm ??

    Thank you very much. Great plugin.

    Luís P. A.

    Plugin Author wpdreams

    (@wpdreams)

    You are welcome ?? I will mark this as resolved then.

    Best,
    Ernest M.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search without writting (trigger)’ is closed to new replies.