|
@@ -570,10 +570,10 @@ const CustomFormWizard = (props) => { |
|
|
address3: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'validateAddressLine3'}))), |
|
|
address3: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'validateAddressLine3'}))), |
|
|
email: yup.string().email(displayErrorMsg(intl.formatMessage({id: 'validEmailFormat'}))).max(255).required(displayErrorMsg(intl.formatMessage({id: 'requireEmail'}))), |
|
|
email: yup.string().email(displayErrorMsg(intl.formatMessage({id: 'validEmailFormat'}))).max(255).required(displayErrorMsg(intl.formatMessage({id: 'requireEmail'}))), |
|
|
emailConfirm: yup.string().email(displayErrorMsg(intl.formatMessage({id: 'validEmailFormat'}))).max(255).required(displayErrorMsg(intl.formatMessage({id: 'requireEmail'}))).oneOf([yup.ref('email'), null], displayErrorMsg(intl.formatMessage({id: 'validSameEmail'}))), |
|
|
emailConfirm: yup.string().email(displayErrorMsg(intl.formatMessage({id: 'validEmailFormat'}))).max(255).required(displayErrorMsg(intl.formatMessage({id: 'requireEmail'}))).oneOf([yup.ref('email'), null], displayErrorMsg(intl.formatMessage({id: 'validSameEmail'}))), |
|
|
idNo: yup.string().required(displayErrorMsg(`請輸入${selectedIdDocInputType}號碼`)) |
|
|
|
|
|
.matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}號碼不包含特殊字符`) }) |
|
|
|
|
|
.matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}號碼不包含空格`) }) |
|
|
|
|
|
.test('checkIDCardFormat', displayErrorMsg(`請輸入有效的${selectedIdDocInputType}號碼`), function (value) { |
|
|
|
|
|
|
|
|
idNo: yup.string().required(displayErrorMsg(`${intl.formatMessage({id: 'require'})}${selectedIdDocInputType}${intl.formatMessage({id: 'number'})}`)) |
|
|
|
|
|
.matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({id: 'noSpecialCharacter'})}`) }) |
|
|
|
|
|
.matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({id: 'noSpace'})}`) }) |
|
|
|
|
|
.test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({id: 'requiredValid'})}${selectedIdDocInputType}${intl.formatMessage({id: 'number'})}`), function (value) { |
|
|
const idDocType = selectedIdDocType.type; |
|
|
const idDocType = selectedIdDocType.type; |
|
|
var pattern_HKIDv1 = /^[A-Z]{1}[0-9]{6}$/; |
|
|
var pattern_HKIDv1 = /^[A-Z]{1}[0-9]{6}$/; |
|
|
var pattern_HKIDv2 = /^[A-Z]{2}[0-9]{6}$/; |
|
|
var pattern_HKIDv2 = /^[A-Z]{2}[0-9]{6}$/; |
|
@@ -891,10 +891,10 @@ const CustomFormWizard = (props) => { |
|
|
//value={selectedIdDocType} |
|
|
//value={selectedIdDocType} |
|
|
size="small" |
|
|
size="small" |
|
|
options={idDocTypeComboList} |
|
|
options={idDocTypeComboList} |
|
|
getOptionLabel={(option) => intl.formatMessage({ id: option.label })} |
|
|
|
|
|
onBlur={formik.handleBlur} |
|
|
onBlur={formik.handleBlur} |
|
|
filterOptions={(options) => options} |
|
|
filterOptions={(options) => options} |
|
|
inputValue={selectedIdDocInputType} |
|
|
inputValue={selectedIdDocInputType} |
|
|
|
|
|
getOptionLabel={(option) => option.label? intl.formatMessage({ id: option.label }) : ""} |
|
|
onChange={(event, newValue) => { |
|
|
onChange={(event, newValue) => { |
|
|
if (newValue != null ) { |
|
|
if (newValue != null ) { |
|
|
setSelectedIdDocInputType(intl.formatMessage({ id: newValue.label })); |
|
|
setSelectedIdDocInputType(intl.formatMessage({ id: newValue.label })); |
|
|