Promise that waits for Dropdown to be rendered

I have a dropdown box in a multistate box. I clear this drop down when the user chooses to go through the multistate box registration again. However, on the second time around after clearing, it seems like the options are not being set to the dropdown because the code is running just before the dropdown is actually rendered.

How do i make a promise that waits till the dropdown is completely rendered before executing the code to apply the drowpdown options?

thank you
-Logan

Hi.

You can check for the rendered status of the dropdown element. If the dropdown is rendered enable the registration element else disable the element. Sample code below:


if($w("#myDropdown").rendered === true){
		//Enable the registration form or element
} else{
	//Disablethe registration form or element
}

Good luck!