THIS IS THE REGISTRATION FORM I PUT TOGETHER:
![](https://static.wixstatic.com/media/a27d24_2f0d0923a857401ca09a684d42a53817~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_2f0d0923a857401ca09a684d42a53817~mv2.png)
and my site is www.sweathands.com if you wanna see it for yourself to get a better understanding.
I get an error code whenever i am testing out the checkbox/registraion page, with the current code i have. if anyone can help me with my errors or fix my code so it is correct, i would greatly appreciate it... thank you.
Here is my code i am using, and the error i get :
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w('#registerbutton').onClick(function () {
let email = $w('#email').value;
let password = $w('#password').value;
wixUsers.register(email, password)
.then(() => {
wixLocation.to('/testing');
})
})
})
export function ps4checkbox_click_1(event) {
"#PS4"();
}
export function pccheckbox_click_1(event) {
"#PC"();
}
export function xboxcheckbox_click(event) {
"#XBOX"();
}
export function nintendoswitchcheckbox_click(event) {
"NintendoSwitch"();
}
export function mobilecheckbox_click(event) {
"Mobile"();
}
function pccheckbox() {
if ($w("#pccheckbox").value === '') { $w("#pccheckbox").value = 'PC'; } else { $w("#pccheckbox").value = ''; }
if ($w("#ps4checkbox").value === '') { $w("#ps4checkbox").value = 'PS4'; } else { $w("#ps4checkbox").value = ''; }
if ($w("#xboxcheckbox").value === '') { $w("#xboxcheckbox").value = 'XBOX'; } else { $w("#xboxcheckbox").value = ''; }
if ($w("#nintendoswitchcheckbox").value === '') { $w("#nintendoswitchcheckbox").value = 'NintendoSwitch'; } else { $w("#nintendoswitchcheckbox").value = ''; }
if ($w("#mobilecheckbox").value === '') { $w("#mobilecheckbox").value = 'Mobile'; } else { $w("#mobilecheckbox").value = ''; }
function valueCombine () {
let checkedValue = $w("#pccheckbox").value + " " + $w("#ps4checkbox").value + " " + $w("#xboxcheckbox").value + " " + $w("#nintendoswitchcheckbox").value + " " + $w("#mobilecheckbox").value;
$w("#testValue").value = checkedValue;}
}
export function registerbutton_mouseIn() {
valueCombine();
}
THE ERROR CODE : ReferenceError: 'valueCombine' is not defined
and when i click on the checkbox's i get : TypeError: Function expected
here is my current error code after I used the code you told me to try: ublic/pages/f5sse.js: 'import' and 'export' may only appear at the top level ( 44 | if ($w("#nintendoswitchcheckbox").value === '') { $w("#nintendoswitchcheckbox").value = 'NintendoSwitch'; } else { $w("#nintendoswitchcheckbox").value = ''; } 45 | if ($w("#mobilecheckbox").value === '') { $w("#mobilecheckbox").value = 'Mobile'; } else { $w("#mobilecheckbox").value = ''; } > 46 | export function registerbutton_mouseIn() { | ^ 47 | 48 | let checkedValue = $w("#pccheckbox").value + " " + $w("#ps4checkbox").value + " " + $w("#xboxcheckbox").value + " " + $w("#nintendoswitchcheckbox").value + " " + $w("#mobilecheckbox").value; 49 | Loading the code for the Registration popup. To debug this code, open f5sse.js in Developer Tools.
and here is my current code for the registration page:
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w('#registerbutton').onClick(function () {
let email = $w('#email').value;
let password = $w('#password').value;
wixUsers.register(email, password)
.then(() => {
wixLocation.to('/testing');
})
})
})
export function ps4checkbox_click_1(event) {
"#PS4"();
}
export function pccheckbox_click_1(event) {
"#PC"();
}
export function xboxcheckbox_click(event) {
"#XBOX"();
}
export function nintendoswitchcheckbox_click(event) {
"NintendoSwitch"();
}
export function mobilecheckbox_click(event) {
"Mobile"();
}
function pccheckbox() {
if ($w("#pccheckbox").value === '') { $w("#pccheckbox").value = 'PC'; } else { $w("#pccheckbox").value = ''; }
if ($w("#ps4checkbox").value === '') { $w("#ps4checkbox").value = 'PS4'; } else { $w("#ps4checkbox").value = ''; }
if ($w("#xboxcheckbox").value === '') { $w("#xboxcheckbox").value = 'XBOX'; } else { $w("#xboxcheckbox").value = ''; }
if ($w("#nintendoswitchcheckbox").value === '') { $w("#nintendoswitchcheckbox").value = 'NintendoSwitch'; } else { $w("#nintendoswitchcheckbox").value = ''; }
if ($w("#mobilecheckbox").value === '') { $w("#mobilecheckbox").value = 'Mobile'; } else { $w("#mobilecheckbox").value = ''; }
export function registerbutton_mouseIn() {
let checkedValue = $w("#pccheckbox").value + " " + $w("#ps4checkbox").value + " " + $w("#xboxcheckbox").value + " " + $w("#nintendoswitchcheckbox").value + " " + $w("#mobilecheckbox").value;
$w("#testValue").value = checkedValue;
}
ANY FURTHER HELP WOULD BE GREATLY APPRECIATED I FEEL LIKE WE ARE CLOSE. THANKS
try like this...
export function registerbutton_mouseIn() { let checkedValue = $w("#pccheckbox").value + " " + $w("#ps4checkbox").value + " " + $w("#xboxcheckbox").value + " " + $w("#nintendoswitchcheckbox").value + " " + $w("#mobilecheckbox").value; $w("#testValue").value = checkedValue; }
you have defined valueCombine above the { } for the mouse-in export function, this means the export function can not see what you have defined for the function valueCombine, hence the reason valueCombine will be undelined in red on your PC screen in the wix editor