better way to do this? ('already declared in upper scope')

  1. in the 2nd on change use event1 instead of event (if you don’t like the yellow mark, which is by the way a warning, not an error. It 's saying: be aware, you’re overriding the event ). In your case since you don’t use the event you can replace it by ()

  2. You can try:

$w("#dropdown1, #dorpdown2").disable();