Hello, I am not very knowledgeable in velo code.
I would like to design a digital scape room with wix. Something similar to this.
example : https://marialb00.wixsite.com/my-site/reto-1
In the check box, students must enter the password to go to the next test (in this example 6870). If they get it right, a green tick appears and an icon to move on to the next test. If they are not correct, a red tick appears.
I am trying with this code shown below put it doesn’t work
My button 3 is validation button
Input 1: Box where user write the key for example 6870 in the example case
Vector image 1 is the green tick
Vector image 2 is the red tick
Vector Image 3 is an arrow that let you to pass to the next test
// API Reference: https://www.wix.com/velo/reference/api-overview/introduction
// “Hello, World!” Example: https://learn-code.wix.com/en/article/1-hello-world
$w . onReady ( function () {
// Write your JavaScript here
// To select an element by ID use: $w("#elementID")
// Click "Preview" to run your code
});
export function button3_click_1 ( event ) {
if ( $w ( ‘#input1’ ). value === ‘6870’ ) {
setTimeout ( function (){
$w ( ‘#vectorImage1’ ). show ()
$w ( ‘#vectorImage2’ ). hide ();
}, 200 );
setTimeout ( function (){
$w ( '#vectorImage3' ). show ( "fade" );
}, 500 );
} **else** {
setTimeout ( function (){
$w ( '#vectorImage1' ). hide ()
$w ( '#vectorImage2' ). show ();
}, 200 );
}
}