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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:44:57+00:00 2026-05-25T16:44:57+00:00

how to modify the tag-it ui plugin https://github.com/aehlke/tag-it (version v2.0) so it only allows

  • 0

how to modify the tag-it ui plugin https://github.com/aehlke/tag-it (version v2.0) so it only allows selection of x numbers of tags and how to allow only tags that are in the “availableTags-option”?

this question (or the first part of it) is already asked and aswerd in the past but for previous version of the plug-in.

  • 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-25T16:44:58+00:00Added an answer on May 25, 2026 at 4:44 pm

    first add custom options (maxTags and onlyAvailableTags) to the plugin file like so…

    options: {
                itemName          : 'item',
                fieldName         : 'tags',
                availableTags     : [],
                tagSource         : null,
                removeConfirmation: false,
                caseSensitive     : true,
                maxTags           : 9999,//maximum tags allowed default almost unlimited
                onlyAvailableTags : false,//boolean, allows tags that are in availableTags or not 
                allowSpaces: false,
                animate: true,
                singleField: false,
                singleFieldDelimiter: ',',
                singleFieldNode: null,
                tabIndex: null,
                onTagAdded  : null,
                onTagRemoved: null,
                onTagClicked: null
            }
    

    next replace the _isNew function with this one…

    _isNew: function(value) {
                var that = this;
                var isNew = true;
                var count = 0;
                this.tagList.children('.tagit-choice').each(function(i) {
                    count++;
    
                    if (that._formatStr(value) == that._formatStr(that.tagLabel(this))|| count >= that.options.maxTags) {
                        isNew = false;
                        return false;
                    }
                    if (that.options.onlyAvailableTags && $.inArray(that._formatStr(value),that.options.availableTags)==-1) {
                        isNew = false;
                        return false;
                    }
    
                });
                return isNew;
            }
    

    Now you can use the options when you initialize tagit. only the sampleTags are allowed with a maximum of 3 tags

    $(function(){
                var sampleTags = ['php', 'coldfusion', 'javascript', 'asp', 'ruby', 'python'];
    
                //-------------------------------
                // Tag events
                //-------------------------------
                var eventTags = $('#s_tags');
                eventTags.tagit({
                    availableTags: sampleTags,
                    caseSensitive: false,
                    onlyAvailableTags: true,
                    maxTags:3,
    
                })
    
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wanting to modify the following query so that it requires both tags exist
How may I modify a XML file without any change like attributes ordering, tag
How can I modify a SharePoint site so that versioning is turned on by
I need to modify a (xml-)file from Apache Ant. loadfile task allows to load
Attachment_fu plugin is kind of old, but I have to modify an old app
I got an object tag (generated by SWFObject) which I'ld like to modify width
I'm trying to modify the vestal_versions plugin to accept a parameter I set upon
My SQL Server view SELECT geo.HyperLinks.CatID, geo.Tags.Tag, geo.HyperLinks.HyperLinksID FROM geo.HyperLinks LEFT OUTER JOIN geo.Tags
i would like modify text of xml tag value i have used an xml
Given a xml file as input howto modify a attribute of a tag with

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.