From 911f396604f1fe3f45b5cc40e3885a975d07fa91 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Mon, 2 Jan 2012 16:41:04 +0100 Subject: [PATCH] Added validation logic to multivalued text field https://fedorahosted.org/freeipa/ticket/1466 --- install/ui/field.js | 30 +++++++++++++++++++++++++++++- install/ui/widget.js | 27 ++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/install/ui/field.js b/install/ui/field.js index fc6b75dda..8db0c87cb 100644 --- a/install/ui/field.js +++ b/install/ui/field.js @@ -522,7 +522,35 @@ IPA.multivalued_field = function(spec) { that.widget_value_changed = function() { that.set_dirty(that.test_dirty()); - //that.validate(); disabling validation for now + that.validate(); + }; + + that.validate = function() { + + that.hide_error(); + that.valid = true; + + var values = that.save(); + + if (that.is_empty(values)) { + return that.valid; + } + + for (var i=0; i