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

  • SEARCH
  • Home
  • 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 8425579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:18:37+00:00 2026-06-10T04:18:37+00:00

I am using jQuery tokeninput to pre-populate a text area. I have an array

  • 0

I am using jQuery tokeninput to pre-populate a text area. I have an array of JSON to pre-populate the text area, The text area is populated correctly but when I look at the <li>‘s created by this plugin it just contain the name of each entry.

How can I get the rest of the information about each entry? In my case like the description, order etc. I need it because I need to insert all these entries into a database.

My jQuery is

<script type="text/javascript">
    $(document).ready(function() {
        $("#text-area").tokenInput("", {
            theme: "facebook",
            prePopulate: [
                          {"id":"04d0d4b2-ac25-11e1-96a5-9787dec335c2","name":"Group 1","description":"Description of Patent Group 1","order":56250000,"is_deleted":false},
                          {"id":"9d4f6e5c-dd73-11e1-bed3-fbfe082dc‌​761","name":"Group 3","description":"Description of Patent Group 3","order":70312500,"is_deleted":false},
                          {"id":"06d0d4b2-ac25-11e1-96a5-9787dec33‌​5c2","name":"Group 2","description":"Description of Patent Group 2","order":84375000,"is_deleted":false}
                         ]
        });
    });
</script>
  • 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-10T04:18:38+00:00Added an answer on June 10, 2026 at 4:18 am

    you need to use the tokenFormatter option:

    A function that returns an interpolated HTML string for each token.
    Use this function with a templating system of your choice, such as
    jresig microtemplates or mustache.js. Use this when you want to
    include images or multiline formatted tokens. Quora’s people invite
    token field that returns avatar tokens is a good example of what can
    be done this option.

    default: function(item){ return “<li><p>” + item.propertyToSearch + “</p></li>” } (demo).

    like this:

    $(document).ready(function() {
        $("#text-area").tokenInput("", {
            theme: "facebook",
            prePopulate: [
                          {"id":"04d0d4b2-ac25-11e1-96a5-9787dec335c2","name":"Group 1","description":"Description of Patent Group 1","order":56250000,"is_deleted":false},
                          {"id":"9d4f6e5c-dd73-11e1-bed3-fbfe082dc‌​761","name":"Group 3","description":"Description of Patent Group 3","order":70312500,"is_deleted":false},
                          {"id":"06d0d4b2-ac25-11e1-96a5-9787dec33‌​5c2","name":"Group 2","description":"Description of Patent Group 2","order":84375000,"is_deleted":false}
                         ],
            resultsFormatter: function(item){ return "<li>" + "<img src='" + item.url + "' title='" + item.name + "' height='25px' width='25px' />" + "<div style='display: inline-block; padding-left: 10px;'><div class='full_name'>" + item.description + " " + item.order + "</div><div class='email'>" + item.is_deleted + "</div></div></li>" },
            tokenFormatter: function(item) { return "<li><p>" + item.name + " <b style='color: red'>" + item.description + "</b></p></li>" },
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Jquery , I have an array result [<a href=><img src=image1></a>,<a href=><img src=image2></a>] if
I'm using tokenInput jquery plugin for autocomplete. This script is working fine <script type=text/javascript>
Using jquery I have a clicking tab mechanism that are nothing but anchor tags
Using jquery 1.7.1, I'm using json to populate the dropdown. The code works just
I'm using capybara-webkit to test a form where the fields are populated using jquery-tokeninput
I installed the JQuery token-input plugin. https://github.com/loopj/jquery-tokeninput Autocomplete is working, but I have a
Using jquery how do I focus the first element (edit field, text area, dropdown
Using jQuery validation plugin but it has no CSV validation. I have made an
I am using Jquery Tokeninput to select multiple values but when i tried to
I'm using a heavily modified version of jquery-tokeninput it's essentially a text input box

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.