From 243073d7a25a491661e0f80a38c42b7034a8807e Mon Sep 17 00:00:00 2001 From: rjy7 Date: Fri, 3 Sep 2010 19:32:35 +0000 Subject: [PATCH] NIHVIVO-1024 When returning from validation error in educational background form (and roles form in repair mode), hide org name validation error if org name field is hidden. --- .../edit/forms/js/customFormWithAutocomplete.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/productMods/edit/forms/js/customFormWithAutocomplete.js b/productMods/edit/forms/js/customFormWithAutocomplete.js index b3c7adc3..6f69b2e8 100644 --- a/productMods/edit/forms/js/customFormWithAutocomplete.js +++ b/productMods/edit/forms/js/customFormWithAutocomplete.js @@ -145,12 +145,7 @@ var customForm = { // autocomplete type can be determined. If a type selection has been made, // unhide the acSelector field. } else if (this.typeSelector.length) { - if (this.typeSelector.val()) { - this.acSelectorWrapper.show() - } - else { - this.acSelectorWrapper.hide(); - } + this.typeSelector.val() ? this.acSelectorWrapper.show() : this.hideFields(this.acSelectorWrapper); } }, @@ -323,9 +318,8 @@ var customForm = { showAutocompleteSelection: function(label, uri) { - this.acSelectorWrapper.hide(); - //this.acSelector.attr('disabled', 'disabled'); - + this.hideFields(this.acSelectorWrapper); + // If form has a type selector, add type name to label. If form has no type selector, // type name is coded into the html. if (this.typeSelector.length) {