I have an x-editable input, which I\'m using to edit usernames. The default action of the element is when you click on itself, you can edit a value. But I want to enable click o
It has a function called enable you can use that to enable edit
$('.edit').click(function(e){
e.stopPropagation();
$('#publicname-change').editable('toggle');
});
This won't work if you don't add the first line because default behaviour is to disable edit on click of any other element.
Edit:
To enable editing only on the click of edit button and not the text, set toggle
property to manual
.
$('#publicname-change').editable({
type: 'text',
url: '/post',
pk: 1,
placement: 'top',
title: 'Enter public name',
toggle:'manual'
}
JSFiddle