Not every submitted form is processed

Hey Ysrael,

Sorry for the delayed reply, I tried to solve it with a code, but it is still not working properly. So this is the code I use:

import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
$w.onReady( function () {
$w(“#input1”).onCustomValidation((value, reject) => {
if (value.length < 0) {
$w(‘#button1’).disable();
reject(“Vorname error”);
} else {
tryRegisterUser();
}
});

$w("#input2").onCustomValidation((value, reject) => { 

if (value.length < 0) {
$w(‘#button1’).disable();
reject(“Name error”);
} else {
tryRegisterUser();
}
});

$w("#input3").onCustomValidation((value, reject) => { 

if (value.length < 0) {
$w(’ #button1 ').disable();
reject(“Name error”);
} else {
tryRegisterUser();
}
});

$w("#input4").onCustomValidation((value, reject) => { 

if (value.length < 6) {
$w(‘#button1’).disable();
reject(“Password error”);
} else {
tryRegisterUser();
}
});

$w("#dropdown1").onCustomValidation((value, reject) => { 

if (value.length < 0) {
$w(‘#button1’).disable();
reject(“Role err”);
} else {
tryRegisterUser();
}
});

function tryRegisterUser() {
if ($w(“#input1”).value.length > 0 && $w(“#input2”).value.length > 0 && $w(“#input3”).value.length >= 3 && $w(“#input4”).value.length >= 6 && $w(“#dropdown1”).value.length > 0) {
$w(‘#button1’).enable();
} else {
$w(‘#button1’).disable();
}
}

$w('#button1').onClick( function  () { 

if ($w(“#input1”).value.length > 0 && $w(“#input2”).value.length > 0 && $w(“#input3”).value.length >= 3 && $w(“#input4”).value.length >= 6 && $w(“#dropdown1”).value.length > 0) {
let email = $w(‘#input3’).value;
let passwort = $w(‘#input4’).value;
const Rolle = $w(‘#dropdown1’).value;
let label;
if (Rolle === “Schauspieler”) {
label = “Schauspieler”;
} else {
label = “Caster”;
}

// register as member using form data
wixUsers.register(email, passwort, {
“contactInfo”: {
“firstName”: $w(‘#input1’).value,
“lastName”: $w(‘#input2’).value,
“emails”: [$w(‘#input3’).value],
“labels”: [label],
}
});
} else {
$w(‘#button1’).disable();
}
});
});