1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Autocomplete types

Discussion in 'XenForo Development Discussions' started by AndyB, Feb 4, 2014.

  1. AndyB

    AndyB Well-Known Member

    When creating an add-on, in the template one can use the Autocomplete code so that usernames can be selected from a dropdown in a form.

    There appears to be two types of Autocomplete:

    1) The one used in the search where more than one username can be selected and submit is required
    2) The one used in the find members search where a one name is selected and is auto-submitted

    The first type always puts in a comma and a space after you select a username. Is there an option to remove this comma and space? The reason I ask is that in my add-on only one username is allowed.

    I know I could use the second type, but that automatically runs the code once a name is selected, I don't want this behavior as I would like the user to have to press the Submit button.

    Thank you.
     
    Last edited: Feb 4, 2014
  2. Syndol

    Syndol Guest

    Use AcSingle:
    <input type="text" name="username" id="ctrl_new_user" class="textCtrl AutoComplete AcSingle" />
     
    Bugfix and AndyB like this.
  3. AndyB

    AndyB Well-Known Member

    Syndol, you're the best.

    Thank you kindly!
     

Share This Page