OR operator not working?

Hello, I have a little experience programming and am trying to setup a validation method for a form entry. The entry is a code and I want it to not be case sensitive so I am trying this but it doesn’t seem to recognize the second option (pizza) Thanks!

$w.onReady( function () {
$w(“#input5”).onCustomValidation( (value, reject) => {
if ( !value.includes(“PIZZA”)||(“pizza”) ) {
reject(“Sorry. incorrect download code”);
}
});
});

try this…

$w.onReady( function () {

$w(‘#input5’).onChange( function () {

let allLowerCaseUserInput = $w(“#input5”).value.toLocaleLowerCase();

if (allLowerCaseUserInput !== “pizza”){

console.log(“Sorry. incorrect download code”);

} else

console.log(“Accepted. correct download code”);

})
})

great thanks, I was wondering if there was a method for it. I’ll try that

How can I include that with the original code to make the box red of the code is incorrect?

just set the input border colour to red with .style

@mikemoynihan99 Got it, thanks! Any way I could print a message below the box? And also just for future reference does the or operator not work in wix or was I just using it wrong?

Hi, I just realized this doesn’t actually stop the code from being submitted

Of course not, there is noting in that code that relates to the submission, it is simply checking if they typed in pizza.

Yes I can see that, I figured out a solution anyway. Just disabled the submit button until the code was correct.