Field not hiding on switch click

Anybody see any reason why my #acctdropdown field is not hiding when my switch is true? I’ve got the switch set to false onReady. When I click the switch to set to true, input3 shows and acctdropdown value is empty but the field didn’t hide.

My code:

export function switch1_click(event) {
if ($w( ‘#switch1’ ).checked) {
$w( ‘#input3’ ).show();
$w( ‘#acctdropdown’ ).value = “” ;
$w( ‘#acctdropdown’ ).hide();
} else
$w( ‘#input3’ ).hide();
$w( ‘#acctdropdown’ ).show();
}

Try having the else part inside curly parentheses { } ;

Ha! beginner dead giveaway! Thanks for your reply! I would have spent another hour trying to track down imaginary nuances of .show()