1

I am using Bootstrap TokenField with Jquery Ui and i have tried to add Images from the Json but when i do, instead of displaying the image, it displays the html code of the image Most fix i have found online or on Stackoverflow add the image from the Javascript by taking the id which I really don't want because my member's profile picture are not based on their id but they are just registered in the database and i want to fetch it out with the json after using my connection to the database

This is my code for Bootstrap Token Field

$('.tokenfield').tokenfield({
  autocomplete: {
        source: "messages_search_peoples.php?nom_field=nom_prenom",
        minLength: 1,

    delay: 100
  },
  showAutocompleteOnFocus: true
});


//Prevent duplicate in the tokenfield

$('.tokenfield').on('tokenfield:createtoken', function (event) {


    var existingTokens = $(this).tokenfield('getTokens');
    $.each(existingTokens, function(index, token) {
        if (token.value === event.attrs.value)
            event.preventDefault();
    });

});

Is there a way of activation the use of html or display the image instead of the code of the image like

Thanks

John Max
  • 432
  • 8
  • 23

0 Answers0