Search code examples
c#.netimageplaceholderjeditable

how to put image to jEditable placeholder?


Image in place-holder displays, but when I click on it - got some <img/> tag in jEditable input. Anyone knows how to remove it ?

    $(document).ready(function () {
    $('#Video3').editable(function (value, settings) {
        companyName(value, "Video3");
        return value;
    },
        {
            cancel: 'Cancel',
            submit: 'OK',
            style: 'inherit',
            tooltip: 'Add video',
            placeholder: '<img class="placeholder"  alt="edit" src="/UserControlsAdmin/ExhibitorZone/img/Add_Video.png" />"
            });
});

Solution

  • I've checked the source code , line 167 removes the placeholder's content if it is equal to settings.placeholder

    /* Remove placeholder text, replace is here because of IE. */
    if ($(this).html().toLowerCase().replace(/(;|"|\/)/g, '') == settings.placeholder.toLowerCase().replace(/(;|"|\/)/g, ''))
    {
        $(this).html('');
    }
    

    you can add this code after that if you want to remove the img tag

    if ($(this).html().toLowerCase().indexOf('img') > -1)
    {
         $(this).html('');
    }