Validate an input with the Value of a Read only input

Hi William!

It should be a pretty simple code that compares the two strings to each other.
Its gonna look something like this:

export function button1_click(event, $w) {
 
 let key = $w('#key2Repeat').text;
 let inputToCheck = $w('#userInput').value;
 
 if (compare(key, inputToCheck)) {
      //message on success 
    } else {
          //message on failure
    }
}

function compare(string1, string2) {
 if (string1 === string2) {
    return true;
    } return false;
}

Hope it helps!
Doron. :slight_smile: