Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7886379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:18:13+00:00 2026-06-03T05:18:13+00:00

I’m looking to use jquery token input but I need the token list to

  • 0

I’m looking to use jquery token input but I need the token list to be separate from the suggestions.

So when you type in a word it will autocomplete, but when the user types , or enter then suggested word will move from that box to an unordered list nearby on the page.

Also the token list (which is not in the input box) still needs to have the x to delete it from the form submission.

Is there a fork that does this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:18:14+00:00Added an answer on June 3, 2026 at 5:18 am

    You could use the onAdd callback to add the token to an <ul> element and remove the token from the suggestion box. Basically something like:

    <input type="text" id="token_field" name="token_field" />
    <input type="hidden" id="hidden_token_ids" name="hidden_token_ids" />
    <ul id="token_display_list"></ul>
    
    <script language="javascript">
      $('#token_field').tokenInput('tokenpath.json', {
        prePopulate: $('#token_field').data('pre'),
    
        // Called every time a token is added to the field
        onAdd: function(item) {
          // Add the item to the external element contents with a link to remove it
          $('#token_display_list').append('<li id="token_' + item.id + '">' + item.name + '<a href="#" onClick="remove_item_from_list(' + item.id + ');">x</a></li>');
    
          // Add the item id to a hidden field which will actually store the values
          // Probably need to add control statements here to ensure no duplication, etc.
          $('#hidden_token_ids').val($('#hidden_token_ids').val() + item.id);
    
          // Remove the just-added token from the input field
          $('#token_field').tokenInput("remove", item);
        }
      });
    
      var remove_item_from_list = function(id) {
        // Remove the token from the cache stored inside tokenInput (only enable if onAdd is not successfully removing the token immediately)
        // $('#token_field').tokenInput("remove", {id : id});
    
        // Remove the id from the hidden list (add control statements here as well)
        $('#hidden_token_ids').val($('#hidden_token_ids').val().replace(id, ''));
    
        // Remove the li element from the visible list
        $('#token_display_list').remove('#token_' + id);
    
        return false;
      }
    </script>
    

    Then on the receiving page, just use the value of #hidden_token_ids which should contain the token ids. You should add some logic to manipulate the string value of that field (make it comma-delimited, strip excess commas on token removal, etc.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I have a jquery bug and I've been looking for hours now, I can't
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.