Event is not defined | external js has this funktion

I have a dropdown and an input field in the HTML.
Both have an onchange event. I have an external script in github where these events are included and I have provided the link to my files in Drapcode via ‘Add JavaScript URL / Script Tag’.

I get the data for the dorpdown as this is populated, but as soon as I make changes the message ‘ReferenceError: handleDropdownChange is not defined’ appears.

How can I ensure that the event accesses my function in the external script?
If I write the function in the internal script, it works.

Hi @morgen_Muesli,

Try adding some wait / sleep and see if that works. It could be happening that your script may be getting triggerred even before the form elements are getting loaded.

Thanks.

Okay, i’ll try this, thanks.

1 Like