Hi Wix Code community,
I’m trying to use this condition into my .onCustomValidation
if( !value.endsWith(“@wix1.com” || “@wix2.com”))
And also i already tried with
if( !value.endsWith(“@wix1.com”) || !value.endsWith (“@wix2.com”))
But it does’n work, any advice is GREATLY appreciated!
--------------------------------- CODE -----------------------------------------
export function input1_keyPress(event) {
$w(‘#text8’).hide();
}
$w.onReady( function () {
$w(“#input1”).onCustomValidation( (value, reject) => {
if (!value.endsWith(“@wix1.com”) || !value.endsWith (“@wix2.com”) ) {
reject(“E-Mail is invalid”);
$w(‘#text8’).show();
} else {
$w(‘#text8’).hide();
}
});
});