This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

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?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40352
    YUANFANYUANFAN
    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 MarcinkoErnest 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')

    #40617
    YUANFANYUANFAN
    Participant

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

    #40622
    Ernest MarcinkoErnest Marcinko
    Keymaster

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.