Clarification on AllowAddNew

Forums Autocomplete Clarification on AllowAddNew

Viewing 1 reply thread
  • Author
    Posts
    • #17373
      Andreas Blüher
      Participant

      allowAddNew
      Type: boolean
      Determines whether or not to allow adding new values to the “dataset”.

      Hello Alexander,

      What does “dataset” mean, if isLookupInself is true also?

      We’re trying to achieve the following setup:
      A user is allowed to add new options at any time, but if he enters more than 2 characters autocomplete shows him possible already existing options. He shall be allowed to type them, without actually selecting them from the dropdown. From what I’ve seen using AC only as a kind of suggestion mechanism doesn’t work, because if the icon doesn’t turn green, the value isn’t set to the column, even though it was char by char a valid option.

      I hope you understand what I mean.

      Kind regards,
      Andreas

    • #17420
      Alexander Bautz
      Keymaster

      Hi,
      Sorry for the late reply. Unfortunately you cannot use this AC as suggestion only – but it might be added in a future release. To be able to add your own value when using “isLookupInSelf” you must set this attribute to true and have the user click the “Add xyz to the list” to add the custom value.

      You can also add a new button to your form to remove the ac and leave a plain text field. Add this in a HTML section below your ac field like this (change “Project” with your field name):

      <input type="button" value="Add your own value" onclick="acAddYourOwnValue(this,'Project')">

      Then add this to the Custom JS:

      function acAddYourOwnValue(btn,fin){
          jQuery(btn).remove();
          spjs.ac.destroy(fin);
      }

      Hope this helps,
      Alexander

Viewing 1 reply thread
  • You must be logged in to reply to this topic.