Update validation on new application form to skip the save button

This commit is contained in:
leigh-mil 2019-04-02 15:05:42 -04:00
parent ade3f38b5e
commit 637efc5ab5
2 changed files with 12 additions and 6 deletions

View File

@ -112,13 +112,16 @@ export default {
validateAndOpenModal: function() { validateAndOpenModal: function() {
let isValid = this.$children.reduce((previous, newVal) => { let isValid = this.$children.reduce((previous, newVal) => {
// display textInput error if it is not valid // display textInput error if it is not valid
if (newVal.$options.name == 'savebutton') {
return true
} else {
if (!newVal.showValid) { if (!newVal.showValid) {
newVal.showError = true newVal.showError = true
} }
return newVal.showValid && previous return newVal.showValid && previous
}
}, true) }, true)
this.validate() this.validate()
isValid = this.errors.length == 0 && isValid isValid = this.errors.length == 0 && isValid

View File

@ -76,7 +76,10 @@
</div> </div>
<div class="action-group"> <div class="action-group">
<button class="usa-button usa-button-primary" tabindex="0" type="submit">{{ 'portfolios.applications.create_button_text' | translate }}</button> <savebutton
text="{{ 'portfolios.applications.create_button_text' | translate }}"
:disabled="disabled">
</savebutton>
</div> </div>
</form> </form>
</new-application> </new-application>