From 5484036ee91dbddaf571f573f81575627f17b531 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Tue, 7 Sep 2010 20:54:13 +0000 Subject: [PATCH] Put focus on acSelector field after type is selected in custom forms. --- productMods/edit/forms/js/customFormWithAutocomplete.js | 9 ++++++++- productMods/edit/forms/personHasPositionHistory.jsp | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/productMods/edit/forms/js/customFormWithAutocomplete.js b/productMods/edit/forms/js/customFormWithAutocomplete.js index 93f8dacc..bc6ff1ad 100644 --- a/productMods/edit/forms/js/customFormWithAutocomplete.js +++ b/productMods/edit/forms/js/customFormWithAutocomplete.js @@ -145,6 +145,7 @@ var customForm = { } else if (this.typeSelector.length) { this.typeSelector.val() ? this.acSelectorWrapper.show() : this.hideFields(this.acSelectorWrapper); } + }, initFormWithValidationErrors: function() { @@ -173,7 +174,13 @@ var customForm = { // Reinitialize view. If no type selection in a two-step form, go back to type view; // otherwise, reinitialize full view. - (!typeVal.length && customForm.formSteps > 1) ? customForm.initFormTypeView() : customForm.initFormFullView(); + if (!typeVal.length && customForm.formSteps > 1) { + customForm.initFormTypeView(); + } + else { + customForm.initFormFullView(); + customForm.acSelector.focus(); + } }); this.verifyMatch.click(function() { diff --git a/productMods/edit/forms/personHasPositionHistory.jsp b/productMods/edit/forms/personHasPositionHistory.jsp index 56ded7b5..86d656eb 100644 --- a/productMods/edit/forms/personHasPositionHistory.jsp +++ b/productMods/edit/forms/personHasPositionHistory.jsp @@ -166,8 +166,6 @@ <% } %> - - { "formUrl" : "${formUrl}",