Home > jquery > New version of jQuery Tag Editor

New version of jQuery Tag Editor

August 1st, 2009 Leave a comment Go to comments

Just updated jQuery Tag Editor to version 1.3. Added another demo as well.

Categories: jquery Tags: , ,
  1. gmwebs
    August 23rd, 2009 at 19:42 | #1

    Hi,

    Had a look at this today and I was wondering if you had any examples of how to use a database with it? In particular, if I want to use it to add tags to images, when I type the new tag and press enter, it appears in the view – how do I actually make it write to the DB though?

    Regards,

    Graham

  2. September 2nd, 2009 at 07:57 | #2

    Hi Graham,

    When you post the form it is in it will be sent as a comma separated string to the server, then depending on what you use serverside to connect to the database you would use something like Request.Forms(“Tags”) (ASP) or $_GET['Tags'] (PHP) and then use the value returned in your database query.

    / Karl

  3. gmwebs
    September 20th, 2009 at 20:48 | #3

    Thanks Karl,

    I am sorry but I might be missing something… Do you have an example of what you describe?

    I am quite happy with posting form data and writing to the DB but the example you have doesn’t actually seem to use a form? Also, the tags are elements…

    If I enclose it within a form, type the tag and press space (it adds the new tag to the div as an ) I don’t see any attempt to access my web server at the URL I specified in the form though.

    Regards,

    Graham

  4. September 23rd, 2009 at 21:18 | #4

    Yes they are elements when shown on the page. Though if you it put in a form-tag and then submit the form the script will create a comma-delimited string that is posted with the form.

  5. January 14th, 2010 at 23:57 | #5

    Hi,
    I have a problem you jQuery plugin. I have been using the same page CKEditor and, xajax submit.
    I remove the problem goes CKEditor. but I have to use the same page. Thank you for your help.

  6. March 15th, 2010 at 13:14 | #6

    Really a great plugin!
    Simple and effective!

    Thanks

  7. March 25th, 2010 at 11:18 | #7

    Hi Karl,
    I’ve found useful a simple change to make the plugin work also within ajax forms. In this case you’ll probably find form tags with filled “onsubmit” attribute, this will prevent the form.submit() event triggering.

    This was the code before:
    var form = $(this).parents(“form”);
    form.submit(function() {
    parse();
    hiddenText.val(itemBase.join(options.separator));
    hiddenText.attr(“id”, textBase.attr(“id”));
    hiddenText.attr(“name”, textBase.attr(“name”));
    textBase.attr(“id”, textBase.attr(“id”) + ‘_old’);
    textBase.attr(“name”, textBase.attr(“name”) + ‘_old’);
    });

    and now:
    var form = $(this).parents(“form”);
    if (“” == form.attr(“onsubmit”)) {
    form.submit(onSubmit);
    }
    else {
    form.children(“[type=submit]“).click(onSubmit);
    }

    function onSubmit() {
    parse();
    hiddenText.val(itemBase.join(options.separator));
    hiddenText.attr(“id”, textBase.attr(“id”));
    hiddenText.attr(“name”, textBase.attr(“name”));
    textBase.attr(“id”, textBase.attr(“id”) + ‘_old’);
    textBase.attr(“name”, textBase.attr(“name”) + ‘_old’);
    }

    Bye

  8. May 22nd, 2010 at 00:03 | #8

    In the case where you have a lot of tags, say 20 tags, they seem to extend across the screen horizontally, as they are displayed “inline”. Is there a simple way to get them to drop down vertically? Perhaps even a blank LI with display set to “block” that is injected every X items?

  1. No trackbacks yet.