Support

Account

Home Forums Front-end Issues ACF select2 sorting

Helping

ACF select2 sorting

  • Hello team,

    I’m using ACF front-end form in which I have multiple select2 fields( ACF default,ajax search enabled ).
    What I want to achieve is whenever I search for any string, It should appear by starting character. So if I’m start searching with letter “M” them options starting with letter “M” should appear but currently it shows all the options having letter “M” anywhere in full string.

  • There is an example of searching by the beginning of strings here https://stackoverflow.com/questions/31571864/select2-search-match-only-words-that-start-with-search-term

    You would need to add custom JS to your site and to something like that. Sorry, I don’t know the exact details or code to add this to an ACF field.

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.