I’m trying to code a sort of quiz website. I’ve already figured out how to use the pattern validation to allow only the correct answer in the input field, and how to use the on_click function to enable the continue button, but I can’t seem to tie the two together properly. Here’s my current attempt, does anybody know where I’m going wrong here?
export function button4_click(event) {
//Add your code for this event here:
let answer = $w( ‘#input1’ );
if (!(answer.valid)) {
$w( “#button2” ).disable();
} **else** {
$w( "#button2" ).enable();
}
}