Within my user control, there is a panel with two controls: ddlType, a drop-down list, and txtOthers, a text box. Initially, txtOthers is set to be invisible.
The goal is for txtOthers to become visible when the user selects an option in ddlType that corresponds to the value 6. Otherwise, it should remain hidden. This functionality needs to be achieved using JavaScript specifically for IE8 in order to prevent unnecessary postbacks.
If (ddlType.value == 6) { txtOthers.Visibility = true; } else { txtOthers.Visibility = false; }
I attempted using the code above, but since the control is initially invisible by default, JavaScript cannot detect its presence.
However, the default visibility of the control is indeed false.