vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 404 forks source link

show error when max reached #674

Open Irfanbsse2060 opened 7 years ago

Irfanbsse2060 commented 7 years ago

i want to show error when max reached. (while editing) how is this possible <span editable-text="user.displayName" onbeforesave="checkName($data)" e-ng-change="checkName" e-form="userDisplayName" edit-disabled="{{!user.displayName}}" e-maxlength="50" e-required ng-disabled="uiSelectForm.$waiting" onaftersave="updateUserProfile(true)">{{user.displayName}}</span> <a ng-click="userDisplayName.$show()" ng-hide="isVisitor || userDisplayName.$visible" > <span class="fa fa-pencil pencil-color"></span> </a>

ckosloski commented 7 years ago

The only way to show errors is by using onbeforesave and have that function return an error

Irfanbsse2060 commented 7 years ago

bt this function gets called when i click on submit button.i want to call function while editing the text field

ckosloski commented 7 years ago

Unfortunately, that is how xeditable works. Maybe you could have an on change function that checks the size and displays an error.