Search code examples
jeditable

jeditable showing placeholder text in edit textbox


I have an issue with jeditable and trying to customize the style of the placeholder text.

        $(".labeledit").editable("....", {
            event: "click",
            onblur: "submit",
            width:($(".labeledit").width() + 40) + "px",
            placeholder: "<span class='placeholder'>add label</span>",
            tooltip: "Click to update"
        });

In the placeholder text I add a span and associate a class. This works fine in the view but when I click on the add label text it places the placeholder text into the textbox so I get

<span class='placeholder'>add label</span>

appearing in the textbox.

If I just have placeholder: "add label" then the add label text doesn't show in the textbox.

What am I doing wrong?


Solution

  • Here it is! Instead of:

    ...
    placeholder: "<span class='placeholder'>add label</span>",
    ...
    

    try switching the quote marks:

    ...
    placeholder: '<span class="placeholder">add label</span>',
    ...