Help with scrollTo with Auto complete for fields

Hi team,

I was wondering if I could get some help, I’m trying to make the payment flow slick and user friendly, I have some functions that execute that scrollTo via onClick or onChange.

But I would like when a certain amount of fields are filled in it will scroll to an element, I can achieve this via onBlur but if the form is auto completed then nothing happens as there isn’t actually any function that runs after the values are filled in. Any ideas?

Thank you!

This works but I was hoping that when the fields are filled it is automatic in case the user doesn’t complete the task in under 4 secs after the function is called.

export function fullname_click(event) {
setTimeout(() => {
if($w("#fullname").value && $w("#email").value && $w("#confirmemail").value && $w('#phonenumber').value && $w('#addressline').value && $w('#postcode').value){
$w('#participantsBlackHeader').scrollTo();
console.log('SUCCESS')
}
}, 4000)
}