onChange query enable/disable

I am attempting to limit people to registering multiple times for an event. I want to query the dataset with an onChange event on the email input. So, if the email exists in the dataset the registration button will be disabled. I also want it to be able to disable/enable accordingly whether the input is a match or not. I will be adding something (ucase) to be sure there are no case discrepancies but one step at a time.

Here is what I have
export function iptEmail_change ( event ) {

let email = $w ( ‘#iptEmail’ ). value
wixData . query ( ‘Attendees’ )
. eq ( ‘email’ , email )
. find ()
. then (( results ) => {
if ( results ) {
$w ( ‘#btnRegister’ ). disable ()
} else {
$w ( ‘#btnRegister’ ).en able ()
}
})

console . log ( $w ( ‘#iptEmail’ ). value )
console . log ()
}
// I would like to know how to query the this function to pull the answer to the question “Did you find a match?” as well

This currently will always enable the iptRegister button with matches in the dataset and otherwise

Instead of

.find()

Write:

.count()

and instead of

 if(results)

Write:

if(results < 1)

and of course:

if(results < 1){button.enable();} else {button.disable();}

(You wrote the opposite).

I won’t be able to look at this closely for a few days, I popped it in just to see if I get results and didn’t but I am sure it is a syntax issue, I will let you know