import wixusers from 'wix-users'; import wixlocation from 'wix-location' import wixwindow from 'wix-window'; import wixdata from 'wix-data'; let registration; $w.onReady(function () { $w('#registrationButton').onClick((event)=>{ console.log("Button was Clicked"); $w('#errorMessage').hide(); $w('#emailExists') if ($w("#email").valid && $w("#password").valid) && $w("#firstname").valid && $W("#lastname"); let email = $w("#email").value let password = $w("#password").value let first = $w('#firstname').value let last = $w("#lastname").value wixusers.register(email, password, { contactinfo:{ "firstname": first, "lastname": last } }) .then((result) =>){ $w("#SuccessMessgae").show(); setTimeout(() => { $w('#SuccessMessgae').hide(); }, 3500); $w("#email").placeholder = "email"; $w("#password").placeholder = "password"; $W("#firstname").placeholder = "first name"; $w("#lastname").placeholder = "last name"; $w("#email").value = ""; $w("#password").value = ""; $w("#firstname").value = ""; $w("#lastname").value = ""; }) .catch((err) =>{ let errMsg = err; console.log(err); $w('#emailExists').show(); }); console.log("trying to register"); } else { $w('#errorMessage').show(); console.log("Missiong Information"); } }); });
![](https://static.wixstatic.com/media/a27d24_b5d20e5ce541459499bfc4ef542a8892~mv2.jpg/v1/fill/w_725,h_276,al_c,q_80,enc_auto/a27d24_b5d20e5ce541459499bfc4ef542a8892~mv2.jpg)
Hi Suman,
This error is happening because of the parenthesis after valid before the && with the error.
To learn how to debug your Corvid code please read the following article. Corvid: Testing and Debugging Your Code
Hope this helps!
Dara | Corvid Team