Jump to:

10929 Posts in 2613 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » tagfield and special characters

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 974 Views
  • dacar
    Avatar
    Community Member
    168 Posts

    tagfield and special characters Link to this post

    Hi,

    If you use tagfield and receive data with special characters from DB then jquery.tags.js will return the html entities. Is there a way to stop that? How can i get the UTF-8 Text from my DB field to the inner HTML input field? I have tried a .replace on line 126 jquery.tags.js but without success.

    How can i get back a plain "&"???

    for (i = 0; i < matches.length; i++) {
    html += '<' + settings.tagWrap + ' class="_tag_suggestion">' + matches + '</' + settings.tagWrap + '>';
    }

    Can anybody help?

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: tagfield and special characters Link to this post

    Hi, problem still not solved, yet.

    In DB the field i am querying has got the Value "Carsten & Carsten".
    But the following line from jquery.tags.js returns "Carsten &amp; Carsten".

    html += '<' + settings.tagWrap + ' class="_tag_suggestion">' + matches + '</' + settings.tagWrap + '>';

    Has anybody an idea?

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: tagfield and special characters Link to this post

    still not solved. can anybod help?

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: tagfield and special characters Link to this post

    I have just put the following code to line 279 of jquery.tags.js

    // replace with jQuery version
    tagMatches = $(tagMatches).click(function (ev) {
    if (ev.target.nodeName.toUpperCase() == settings.tagWrap.toUpperCase() && $(ev.target).is('._tag_suggestion')) {
    chooseTag(ev.target.innerHTML.replace(/&amp;/g, "&"));
                   // alert(ev.target.innerHTML.replace(/&amp;/g, "&"));
    }
    }).addClass(settings.matchClass);

    seems to be working... ;-)

    974 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.