How to position the focus of the input box?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to position the focus of the input box?

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 month, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40352
    YUANFAN
    YUANFAN
    Participant

    I have a carriage return event, but I can’t get focus.

    var search = window.parent.document.querySelector(‘input.orig’);
    search.value =”AAA”;
    search.focus();
    search.dispatchEvent(event);

    #40361
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    This works just fine on my end, it focuses perfectly fine. To dispatch events you don’t have to focus the input though. If it does not trigger, then there might be an issue in the code.

    You can use the javascript API to trigger the search redirection event, if that is what you are looking for:

    ASP.api(1, 'searchRedirect')

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #40617
    YUANFAN
    YUANFAN
    Participant

    ASP.api(1, “searchRedirect”, “search phrase”)Very convenient, is it possible to set the target?

    #40622
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Not via API, but you can set it on the back-end: https://i.imgur.com/Dt4MHXt.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.