From 637efc5ab593b33cf6b0daa1d9f6b75f3ea46f05 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Tue, 2 Apr 2019 15:05:42 -0400 Subject: [PATCH] Update validation on new application form to skip the save button --- js/components/forms/new_application.js | 13 ++++++++----- templates/portfolios/applications/new.html | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/js/components/forms/new_application.js b/js/components/forms/new_application.js index b9275c3b..edc780e0 100644 --- a/js/components/forms/new_application.js +++ b/js/components/forms/new_application.js @@ -112,13 +112,16 @@ export default { validateAndOpenModal: function() { let isValid = this.$children.reduce((previous, newVal) => { // display textInput error if it is not valid - if (!newVal.showValid) { - newVal.showError = true + if (newVal.$options.name == 'savebutton') { + return true + } else { + if (!newVal.showValid) { + newVal.showError = true + } + + return newVal.showValid && previous } - - return newVal.showValid && previous }, true) - this.validate() isValid = this.errors.length == 0 && isValid diff --git a/templates/portfolios/applications/new.html b/templates/portfolios/applications/new.html index 343bb10a..9c2fc021 100644 --- a/templates/portfolios/applications/new.html +++ b/templates/portfolios/applications/new.html @@ -76,7 +76,10 @@
- + +