@@ -28,6 +28,7 @@ const PageRegistrationForm = ({ editFieldsPage, initialValues, onEditSubmit }) =
2828 const [ canRegister , setCanRegister ] = useState ( true ) ;
2929 const [ checkoutUrl , setCheckoutUrl ] = useState ( '' ) ;
3030 const [ errorAfterEdit , setErrorAfterEdit ] = useState ( false ) ;
31+ const [ anyError , setAnyError ] = useState ( false ) ;
3132
3233 const { axios } = useAxios ( ) ;
3334
@@ -46,8 +47,10 @@ const PageRegistrationForm = ({ editFieldsPage, initialValues, onEditSubmit }) =
4647 const isFormValid = validateForm ( ) ;
4748 // console.log(isFormValid)
4849 if ( ! isFormValid ) {
50+ setAnyError ( true ) ;
4951 return setCanRegister ( true ) ;
5052 } else {
53+ setAnyError ( true ) ;
5154 try {
5255 // const convertedFroshObject = { ...froshObject };
5356
@@ -297,6 +300,7 @@ const PageRegistrationForm = ({ editFieldsPage, initialValues, onEditSubmit }) =
297300 : false
298301 }
299302 disabledIndices = { field . disabledIndices }
303+ errorFeedback = { field . errorFeedback }
300304 initialSelectedIndices = {
301305 editFieldsPage === true
302306 ? field . values . reduce ( ( prev , curr , index ) => {
@@ -436,6 +440,11 @@ const PageRegistrationForm = ({ editFieldsPage, initialValues, onEditSubmit }) =
436440 title : 'General' ,
437441 component : (
438442 < >
443+ { anyError == true && selectedTab == 0 ? (
444+ < h3 className = "registration-error-msg" >
445+ Please make sure you have filled out all required fields correctly.
446+ </ h3 >
447+ ) : null }
439448 < div className = "registration-first-step-header-container" >
440449 < img className = "registration-icon-logo" src = { MainFroshLogo } > </ img >
441450 < div >
@@ -459,7 +468,16 @@ const PageRegistrationForm = ({ editFieldsPage, initialValues, onEditSubmit }) =
459468 } ,
460469 {
461470 title : 'Health & Safety' ,
462- component : generateStepComponent ( formFields [ 'HealthSafety' ] , 'HealthSafety' ) ,
471+ component : (
472+ < >
473+ { anyError == true && selectedTab == 1 ? (
474+ < h3 className = "registration-error-msg" >
475+ Please make sure you have filled out all required fields correctly.
476+ </ h3 >
477+ ) : null }
478+ { generateStepComponent ( formFields [ 'HealthSafety' ] , 'HealthSafety' ) }
479+ </ >
480+ ) ,
463481 } ,
464482 {
465483 title : 'Extra Events' ,
0 commit comments