I am trying to disable a input field on selection of a input field. Here is my code but its not working... anyone? also enabled properties..

export function dropdown1_change(event) {
let purpose=$w(‘#dropdown1’).value
if (purpose===‘Indeminity’){ // indeminity is one of the value in drop down
$w(“#input8”).disable();}
else
{$w(“#input8”).enable();
}
}

Your code should work fine, which leads me to believe that there is some mismatch in a dropdown value that can be found in the Manage Choices section of an element and in your code.

Please note, that the text that is shown in a dropdown itself may not match the value of a dropdown field:

You can find more information here: https://support.wix.com/en/article/adding-and-setting-up-a-dropdown-list

Hey thanks. I am indeed taking value field only.

Hi, Kunwar.

Something I always recommend is to replace generic names like dropdown1 and input8 with mnemonic (memory-aiding/meaningful) names. It makes your code more self-documenting (and there’s always the possibility that doing that may help you resolve the issue you’re experiencing and reporting).