export function validatew(items) {
//Add your code for this event here:
console.log(“items”, items)
let itempw = items;
console.log(“item values:”, itempw);
if ( $w(‘#iInput1’).value === itempw) {
console.log(“Paging to Services page”);
validity = “yes”
wixLocation.to(‘/services’);
} else
{
validity = “no”
}
}
In this code value to this function is passed thru a higher level function via ‘items’. When it is referenced to display it is displaying correct values. But when the same is used in ‘IF’ statement it is not comparing though both sides are equal. Always going to ‘ELSE’ part. Is any wise wixers can help on how to referencing the variable in the IF statements?