summaryrefslogtreecommitdiffstats
path: root/install/ui/widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r--install/ui/widget.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 38826ee9d..344d701c2 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -39,6 +39,8 @@ IPA.widget = function(spec) {
that.disabled = spec.disabled;
that.hidden = spec.hidden;
that.conditional = spec.conditional;
+ that.optional = spec.optional || false;
+
// read_only is set during initialization
that.read_only = spec.read_only;
@@ -79,6 +81,12 @@ IPA.widget = function(spec) {
var values = that.save();
if (!values || !values.length) {
+ if (that.param_info &&
+ that.param_info.required &&
+ !that.optional) {
+ that.valid = false;
+ that.show_error('required field');
+ }
return;
}