From 6e967d8fe709150d44b9af8df7312641a8747acf Mon Sep 17 00:00:00 2001 From: Adam Young Date: Mon, 27 Jun 2011 15:57:40 -0400 Subject: validate required fields https://fedorahosted.org/freeipa/ticket/1329 overides required with optional. --- install/ui/widget.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'install/ui/widget.js') diff --git a/install/ui/widget.js b/install/ui/widget.js index 38826ee9..344d701c 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; } -- cgit