In my previous post I talked about adding size and stylesheets to an inline editable field with jEditable.
I have this div:
<div >
<div class="mouseover"> Title </div>
<div class="help_text"> (Click on the Title to edit) </div>
</div >
I had to add some text next to this field which says "click to edit". When a user clicks on it , I wanted to add a callback function to this field, so that when I click on it title comes in input tag as inline editable and the text in next div (Clieck on the Title to edit) should go away. I found that you can use callback here just like in any ajax call.
Here is what I did:
$(".mouseover").editable('<custom url>', {
indicator : '<custom image path>',
onblur : "submit",
placeholder : "click here to edit",
type : "custom_input",
callback : function(data, settings){
$(this).siblings(".help_text").text("(Click on the label to edit)");
}
});
(posting it ... so that someone else should not spend time in figuring out :)
I have this div:
<div >
<div class="mouseover"> Title </div>
<div class="help_text"> (Click on the Title to edit) </div>
</div >
I had to add some text next to this field which says "click to edit". When a user clicks on it , I wanted to add a callback function to this field, so that when I click on it title comes in input tag as inline editable and the text in next div (Clieck on the Title to edit) should go away. I found that you can use callback here just like in any ajax call.
Here is what I did:
$(".mouseover").editable('<custom url>', {
indicator : '<custom image path>',
onblur : "submit",
placeholder : "click here to edit",
type : "custom_input",
callback : function(data, settings){
$(this).siblings(".help_text").text("(Click on the label to edit)");
}
});
(posting it ... so that someone else should not spend time in figuring out :)