Input validation on Portal -: sp-editable-fileds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Team,
I have below HTML code and the profile page(First name, last name, email,phone render using Inline sp-editable-fileds(fieldModel) , not using HTML input) So How we can add validation (invalid input)on that profile page.
Note: Cancel and save button are field specific its not global)
<div class="panel panel-default b" ng-if="getSysUserModelFields().length > 0">
<div class="panel-heading">
<h2 class="panel-title">
<i class="fa fa-info-circle m-r-sm"></i>${About}
</h2>
</div>
<div class="body padder-xs">
<div class="list-group">
<div ng-repeat="fieldModel in sysUserModelFields">
<div class="list-group-item">
<div>
<sp-editable-field block="true" table="{{data.table}}" editable-by-user="data.isLoggedInUsersProfile" table-id="data.sysUserID" field-model="fieldModel"></sp-editable-field>
</div>
</div>
</div>
</div>
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @sonalishind ,
sp-editable-field element to handle value changes.
Example:
Client Controller:
$scope.onChangeCompany = function (gform, shadowModel, oldValue, newValue) {
if (oldValue !== newValue) {
$scope.data.sysUserModel.department = "";
$scope.data.sysUserModel.location = "";
}
};
HTML:
<sp-editable-field ng-if="::displayField('sys_user', 'company', true)"
editable-by-user="data.isLoggedInUsersProfile"
table="sys_user"
table-id="data.sysUserID"
field-model="data.sysUserModel.company"
on-change="onChangeCompany"></sp-editable-field>
