Update validation on new application form to skip the save button
This commit is contained in:
parent
ade3f38b5e
commit
637efc5ab5
@ -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
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user