I'd like to have jEditable placeholder with distinguishing style, so I tried to include simple span
into placeholder
attribute and it looks as I expected, however, on click it works like default value but displays the placeholder's content as raw HTML code in the input box:
$(function() {
$(".testjedit").each(function() {
var old_value = $(this).attr( 'data-default' );
var ph = $(this).attr( 'data-placeholder' );
$(this).editable("http://localhost/index.php/welcome/update_record", {
"callback": function( value, settings ) {
$( this ).attr('data-default', value );
},
"placeholder": "<span class='ph'>" + ph + "</span>",
"submitdata": {
"oldvalue": old_value,
"check": 1
}
});
});
});
I put it all together into jsfiddle, so you can play with it to see what is wrong. Try to click on "Comment".