I am using xeditable to have inline editable functionality, but now I am stuck trying to validate my input.
Here is an example using jsFiddle
I tried the below code with no success.
validate: function(value) {
if($.trim(value) == '')
return 'This field is required';
}
You can define a validation function like this:
$scope.validateRequired = function(value) {
if(!value)
return "Required field";
};
Then use it with the event onbeforesave
onbeforesave="validateRequired($data)"
Please check: