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 7664879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:25:00+00:00 2026-05-31T14:25:00+00:00

Possible Duplicate: Trying to get tag-it to work with an AJAX call How can

  • 0

Possible Duplicate:
Trying to get tag-it to work with an AJAX call

How can I get tags from the database for autocomplete.

I thing I can handle the php part by myself 🙂

This is the minimal code for the autocomplete feature and I really don’t get it how to post the tag to php.

$(function(){
    $('#tags').tagit({
        availableTags: ['c++', 'java', 'php', 'coldfusion', 'javascript', 'asp', 'ruby', 'python', 'c', 'scala', 'groovy', 'haskell', 'perl', 'erlang', 'apl', 'cobol', 'go', 'lua']
    });
});

you can find the full code here:
http://aehlke.github.com/tag-it/css/jquery.tagit.css

  • 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-05-31T14:25:02+00:00Added an answer on May 31, 2026 at 2:25 pm

    Do you want to fill in availableTags variable with available tags from the database?
    You can simply do

    <?php
    echo "'$tag1', ";
    echo "'$tag2', ";
    ...
    ?>
    

    between [ and ]

    Or you can of course get your data with $.ajax() or $.get()
    For example:

    $.get('available.php', function(data) {
    console.dir(data);
    });
    

    In case you are doing autocomplete, you can have your PHP script respond with available tags by given entry, for example:

    <?php
    $response = Array();
    foreach ($tags as $tag) {
    if (strpos($tag, $entry) !== false) $response[] = $tag;
    }
    
    now echo $response array as json or xml or whatever you want
    ?>
    

    On the JavaScript part you would invoke on each keypress a call similar to this:

    $.ajax({
      type: "POST",
      url: "available.php",
      data: "entry="+ $('input[name=entry]').val(),
    }).done(function( data) {
      // invoke your TagIt plugin with data but first decode it
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Uploadify: show error message from HTTP response I am trying to get
Possible Duplicate: How can I get this ASP.NET MVC SelectList to work? What the
Possible Duplicate: outputting values from database into html table PHP I am trying to
Possible Duplicate: Get URL of ASP.Net Page in code-behind I'm trying to hold current
Possible Duplicate: jQuery get input value after keypress I'm trying to get an input
Possible Duplicate: Get output from a process Executing DOS commands from Java I am
Possible Duplicate: How can I get an element's serialised HTML with PHP's DOMDocument? PHP
Possible Duplicate: How do I get this CSS text-decoration issue to work? I'm using
Possible Duplicate: Can a number used to name a sql column I am trying
Possible Duplicate: How to reference mockito within tycho? I am trying to get a

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.