Allo custom value in autocomplete text box

Home Forums Autocomplete Allo custom value in autocomplete text box

Viewing 5 reply threads
  • Author
    Posts
    • #10248
      Dirk Loehn
      Participant

        Hello Alexander,

        is there any way to allow additional custom values in the autocomplete text box. Right now the autocomplete enforces the selection of an existing entry. In our Case we pull a list of suppliers for the autocomplete field, but would like to allow the user to type in a custom supplier name. If you do so now and leave the autocomplete field, the entry is deleted.

        Is it possible to add such an Option, or is there an easy Workaround?

        Thanks a lot,

        Dirk

      • #10259
        Alexander Bautz
        Keymaster

          Hi,
          Sorry, but this is currently not possible. I have just answered the same question here

          I’ll try to get this added, but I’m a bit busy right now.

          Alexander

        • #10326
          Alexander Bautz
          Keymaster
          • #10331
            Dirk Loehn
            Participant

              Works great with adding a new entry, thanks a lot!!!

              One problem still is with localization.
              E.g. if we set translated attributes like
              if (lcid == 1031){
              // GERMAN
              spjs.ac.text = {“noItems”:”Keinen passenden Eintrag gefunden”, “noValidItems”:”Keinen gültigen Eintrag gefunden”,
              “invalid”:”Auswahl ist ungültig”,
              “moreItemsLabel”:”Es werden die ersten {0} Einträge angezeigt”,
              “moreItemsMouseover”:”Geben Sie weitere Zeichen ein, um die Auswahl einzugrenzen”,
              “searching”:”Suche nach: ”
              };

              then entering an entry with no Match will result in deleting the entry.
              We have used the setting:
              “allowAddNew”:true, // New in v1.4
              “isLookupInSelf”:false, // New in v1.4

              Apart form this its working great!!!

            • #10333
              Alexander Bautz
              Keymaster

                Hi,
                You must update the “spjs.ac.text” object for 1031 to include the new key/value pair:

                "addNewItem":"Add {0} to the list?"

                You find this in the description in the original article here (under “Override the labels and text”): https://spjsblog.com/2014/03/29/autocomplete-for-text-and-people-picker-fields/

                Does this help?

                Alexander

              • #10335
                Dirk Loehn
                Participant

                  Wonderful!

                  works like a charm – Thanks

              Viewing 5 reply threads
              • You must be logged in to reply to this topic.