| @@ -188,7 +188,9 @@ const CustomFormWizard = (props) => { | |||||
| } | } | ||||
| const checkDataField = (data) => { | const checkDataField = (data) => { | ||||
| if (data.username !== "" && | |||||
| // console.log(data) | |||||
| if (handleCaptcha(data.captchaField) && | |||||
| data.username !== "" && | |||||
| data.password !== "" && | data.password !== "" && | ||||
| data.confirmPassword !== "" && | data.confirmPassword !== "" && | ||||
| data.password == data.confirmPassword && | data.password == data.confirmPassword && | ||||
| @@ -205,13 +207,12 @@ const CustomFormWizard = (props) => { | |||||
| data.phoneCountryCode !== "" && | data.phoneCountryCode !== "" && | ||||
| termsAndConAccept == true && | termsAndConAccept == true && | ||||
| fileList.length !== 0 && | fileList.length !== 0 && | ||||
| data.captchaField && | |||||
| // data.captchaField && | |||||
| handlePassword(data.password) && | handlePassword(data.password) && | ||||
| handleEmail(data.email) && | handleEmail(data.email) && | ||||
| handleIdNo(data.idNo, selectedIdDocType.type, data.checkDigit) && | handleIdNo(data.idNo, selectedIdDocType.type, data.checkDigit) && | ||||
| handlePhone(data.phone) && | handlePhone(data.phone) && | ||||
| handleUsername(data.username) && | handleUsername(data.username) && | ||||
| handleCaptcha(data.captchaField) && | |||||
| !checkUsername && | !checkUsername && | ||||
| !checkEmail | !checkEmail | ||||
| ) { | ) { | ||||
| @@ -443,7 +444,12 @@ const CustomFormWizard = (props) => { | |||||
| } | } | ||||
| function handleCaptcha(captchaField) { | function handleCaptcha(captchaField) { | ||||
| return captchaField; | |||||
| // console.log(captchaField.length) | |||||
| if (captchaField.length == 5 ){ | |||||
| return true | |||||
| } else { | |||||
| return false | |||||
| } | |||||
| } | } | ||||
| function handleIdNo(idNo, selectedIdDocType, checkDigit) { | function handleIdNo(idNo, selectedIdDocType, checkDigit) { | ||||
| @@ -672,7 +678,7 @@ const CustomFormWizard = (props) => { | |||||
| // faxCountryCode: yup.string().min(3,'請輸入3位數字'), | // faxCountryCode: yup.string().min(3,'請輸入3位數字'), | ||||
| phone: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requireAtLeast8Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))), | phone: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requireAtLeast8Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))), | ||||
| // fax: yup.string().min(8,'請輸入8位數字'), | // fax: yup.string().min(8,'請輸入8位數字'), | ||||
| captchaField: yup.string().max(5, getMaxErrStr(5)).required(displayErrorMsg(intl.formatMessage({ id: 'requireVerify' }))),//.oneOf([captcha], displayErrorMsg('請輸入有效驗證')), | |||||
| captchaField: yup.string().max(5, getMaxErrStr(5)).required(displayErrorMsg(intl.formatMessage({ id: 'requireVerify' }))).min(5, displayErrorMsg(intl.formatMessage({ id: 'requireVerify' }))),//.oneOf([captcha], displayErrorMsg('請輸入有效驗證')), | |||||
| }), | }), | ||||
| }); | }); | ||||