I'm debugging a JavaScript/JSP/Struts app, it has a checkbox, for advanced search, when it's checked, other 2 items are supposed to show up on the page for user to enter more info, yet this only works in IE, but not Firefox or Chrome, no response at all when it's checked on the other 2 browsers, why ? And how to make it work in all browsers ?
<script type="text/javascript">
function checkAdvSearch(checked) {
if(checked) {
document.getElementById("searchTerm2").style.display = '';
document.getElementById("searchField2").style.display = '';
}else {
document.getElementById("searchTerm2").style.display = 'none';
document.getElementById("searchField2").style.display = 'none';
document.getElementById("searchLOB").style.display = 'none';
document.getElementById("searchTerm2").value = '';
document.getElementById("searchField2").value = 'clientName';
document.getElementById("searchStatus").value = '';
document.getElementById("searchLOB").value = '';
}
}
</script>
...
<!-- for advanced search -->
<td Valign=top width=300>
<input type="checkbox" name="advSearch" onclick="checkAdvSearch(this.checked);" tabindex="5"/>Advanced Search
<html:text property="searchTerm2" value="" style="display:none" tabindex="6"/>
</td>
<td Valign=top width=178>
<html:select property="searchField2" onchange="showOptions2(this.form)" value= "" style="display:none" tabindex="7">
<html:option value="clientName">Insured Name</html:option>
<html:option value="policy">Policy Number</html:option>
...
</html:select>
</td>
...