Small help with code

I need in this code Error message when the person write wrong value in input.
Somthing like “show” box1 (box1 is error message).

And i need that “let value = 111” not only numbers allowed. I want make with letter.

This is code:

export function button175_click(event) { 
let value = 111;
let valueS = value.toString()
if ($w("#input1").value === valueS) {
wixWindow.openLightbox('Test'); 
}
}

Thanks for you help!!! :slight_smile:

https://russian-dima.wixsite.com/meinewebsite/lightbox

@russian-dima and with somthing like “show” box1 (box1 is error message)., you can help me pls?

$w.onReady(()=>{
    let myPW = "111";
    //let valueS = value.toString()
    $w('#myBox').show()
    $w('#button175').onClick(()=>{
        if(($w("#input1").value).toString() === myPW){console.log("OK")
            $w('#myTextBoxInABox).text = "CORRECT!"
        }
    
        else {console.log("ERROR")
            $w('#myTextBoxInABox).text = "ERROR"
        }
    })
    setTimeout(()=>{$w('#myBox').hide()},1500)
})
1 Like