diff options
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r-- | install/ui/widget.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js index 90f6dac8b..f34532d23 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -46,6 +46,7 @@ IPA.widget = function(spec) { that.save = spec.save || save; that.update = spec.update || update; that.validate_input = spec.validate_input || validate_input; + that.valid = true; that.param_info = spec.param_info; that.__defineGetter__("entity_name", function(){ @@ -61,23 +62,25 @@ IPA.widget = function(spec) { displays the error message and returns false. */ function validate_input(text) { if (!(that.param_info && that.param_info.pattern)) { - return true; + that.valid = true; + return; } var error_link = that.get_error_link(); if (!error_link) { - return true; + that.valid = true; + return; } var regex = new RegExp( that.param_info.pattern ); //If the field is empty, don't validate if ( !text || text.match(regex) ) { error_link.css('display', 'none'); - return true; + that.valid = true; }else{ error_link.css('display', 'block'); if (that.param_info.pattern_errmsg) { error_link.html(that.param_info.pattern_errmsg); } - return false; + that.valid = false; } } |