Merge pull request #976 from dod-ccpo/activate-next-buttons-to-form
Activate next buttons on TO form
This commit is contained in:
commit
ec94c3d084
@ -19,11 +19,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
created: function() {
|
||||||
|
emitEvent('field-mount', this, {
|
||||||
|
optional: this.optional,
|
||||||
|
name: this.name,
|
||||||
|
valid: this.isChecked,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onInput: function(e) {
|
onInput: function(e) {
|
||||||
emitEvent('field-change', this, {
|
emitEvent('field-change', this, {
|
||||||
value: e.target.checked,
|
value: e.target.checked,
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
valid: this.isChecked,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
initialSelectedSection: String,
|
initialSelectedSection: String,
|
||||||
|
hasChanges: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
@ -44,6 +48,20 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
canSave: function() {
|
||||||
|
const formValid = !this.invalid
|
||||||
|
|
||||||
|
if (formValid) {
|
||||||
|
return true
|
||||||
|
} else if (this.changed && formValid) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
changed: this.hasChanges,
|
changed: this.hasChanges,
|
||||||
@ -51,11 +69,4 @@ export default {
|
|||||||
invalid: true,
|
invalid: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
|
||||||
hasChanges: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<input
|
<input
|
||||||
type="submit"
|
type="submit"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
:disabled="!changed"
|
:disabled="!canSave"
|
||||||
value="{{ next_button_text }}"
|
value="{{ next_button_text }}"
|
||||||
form="to_form"
|
form="to_form"
|
||||||
class="usa-button usa-button-primary">
|
class="usa-button usa-button-primary">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user