{
await handleSubmit(e);
- switch (pageIndex) {
- case 0:
- if ($errors.name || $errors.email || $errors.telephone) {
- return;
- }
- break;
-
- case 1:
- if ($errors.birthSurname || $errors.birthPlace || $errors.birthDate || $errors.sex) {
- return;
- }
- break;
- case 2:
- if ($errors.home || $errors.parentEmail || $errors.parentTelephone) {
- return;
- }
- break;
- case 3:
- if (
- $errors.citizenship ||
- $errors.personalId ||
- $errors.study ||
- $errors.applicationId
- ) {
- return;
- }
- break;
- default:
- break;
+ if (isPageInvalid()) return;
+ if (pageIndex === pageCount) {
+ alert('should submit');
+ } else {
+ pagesFilled++;
+ pageIndex++;
}
-
- pageIndex++;
errors.set(formInitialValues);
}}
- class="w-full mt-8 md:w-3/5 p-3 rounded-lg font-semibold text-xl transition-colors duration-300 bg-sspsBlue hover:bg-sspsBlueDark text-white"
+ class="w-full mt-8 md:w-3/5 p-3 rounded-lg font-semibold text-xl transition-colors duration-300 bg-sspsBlue hover:bg-sspsBlueDark text-white hover:cursor-pointer"
type="submit"
value={pageIndex === pageCount ? 'Odeslat' : 'Pokračovat'}
/>
{#each Array(pageCount + 1) as _, i}
-
+
@@ -305,6 +322,11 @@
@apply w-full;
@apply items-center justify-center;
}
+ .dot {
+ @apply ml-2 w-4 h-4
+ @apply hover:cursor-pointer hover:bg-sspsBlue
+ @apply rounded-full bg-sspsGray;
+ }
.dotActive {
@apply bg-sspsBlue;
}