从您的问题中不确定哪个字段需要消失:下拉菜单或下面的标签?让我们假设标签。
<td>
<s:select
id="dropDownId"
headerKey="none" headerValue="Select UI Controller"
list="UiControllersMap"
name="uiController"
onchange="hideField()"
/>
<s:fielderror id="fieldId" fieldName="uiController" cssClass="customErrorMessage"/>
</td>
<script language="text/javascript">
function hideField() {
dropDown = document.getElementById("dropDownId");
fieldError = document.getElementById("fieldId");
if (dropDown && fieldError) {
if (dropDown.options[dropDown.selectedIndex].text == fieldError.innerText) {
fieldError.style.display='none';
}
else {
fieldError.style.display='';
}
}
}
</script>