mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
Phone Number 'Required' Validation
This commit is contained in:
parent
10e49d87b3
commit
21941ecf86
1 changed files with 1 additions and 5 deletions
|
@ -455,14 +455,10 @@ module.exports = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onValidSubmit: function (formData, reset, invalidate) {
|
onValidSubmit: function (formData, reset, invalidate) {
|
||||||
if (!formData.phone) {
|
if (!formData.phone || formData.phone.national_number === '+') {
|
||||||
return invalidate({
|
return invalidate({
|
||||||
'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationRequired'})
|
'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationRequired'})
|
||||||
});
|
});
|
||||||
} else if (formData.phone.national_number === '+') {
|
|
||||||
return invalidate({
|
|
||||||
'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationPhoneNumber'})
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return this.props.onNextStep(formData);
|
return this.props.onNextStep(formData);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue