On Permissions detail page, Permission radio button is now required and validation works correctly.

This commit is contained in:
chouseknecht
2013-06-26 12:14:21 -04:00
parent cfb638e8e1
commit 453c13f116
3 changed files with 11 additions and 1 deletions

View File

@@ -399,9 +399,15 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += "ng-model=\"" + fld + "\" ";
html += (field.ngChange) ? this.attr(field,'ngChange') : "";
html += (field.readonly) ? "readonly " : "";
html += (options.mode == 'edit' && field.editRequired) ? "required " : "";
html += (options.mode == 'add' && field.addRequired) ? "required " : "";
html += " /> " + field.options[i].label + "\n";
html += "</label>\n";
}
if ( (options.mode == 'add' && field.addRequired) || (options.mode == 'edit' && field.editRequired) ) {
html += "<span class=\"error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " +
this.form.name + '_form.' + fld + ".$error.required\">A value is required!</span>\n";
}
html += "<p><span class=\"error api-error\" ng-bind=\"" + fld + "_api_error\"></span></p>\n";
html += "</div>\n";
html += "</div>\n";