Merge pull request #1039 from dod-ccpo/user-profile-validation
User profile validation
This commit is contained in:
@@ -36,6 +36,7 @@ export default {
|
||||
month: this.initialmonth,
|
||||
year: this.initialyear,
|
||||
name: this.nameTag,
|
||||
showValidation: false,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -160,6 +161,8 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput: function(e) {
|
||||
this.showValidation = true
|
||||
|
||||
emitEvent('field-change', this, {
|
||||
value: this.formattedDate,
|
||||
name: this.name,
|
||||
|
@@ -36,7 +36,7 @@ export default {
|
||||
const showError = (this.initialErrors && this.initialErrors.length) || false
|
||||
return {
|
||||
showError: showError,
|
||||
showValid: !showError && !!this.initialValue,
|
||||
showValid: false,
|
||||
validationError: this.initialErrors.join(' '),
|
||||
value: this.initialValue,
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
insetForm: Boolean,
|
||||
},
|
||||
|
||||
data: function() {
|
||||
@@ -61,7 +60,7 @@ export default {
|
||||
this._checkIfValid({
|
||||
value: this.value,
|
||||
invalidate: true,
|
||||
showValidationIcon: !this.insetForm,
|
||||
showValidationIcon: false,
|
||||
})
|
||||
|
||||
if (this.mask && this.validation !== 'email') {
|
||||
@@ -103,6 +102,8 @@ export default {
|
||||
onBlur: function(e) {
|
||||
if (!(this.optional && e.target.value === '')) {
|
||||
this._checkIfValid({ value: e.target.value.trim(), invalidate: true })
|
||||
} else if (this.modified && !this.optional) {
|
||||
this._checkIfValid({ value: e.target.value.trim(), invalidate: true })
|
||||
}
|
||||
this.value = e.target.value.trim()
|
||||
|
||||
|
Reference in New Issue
Block a user