TheCandyman
Technical User
I'm trying to have a row hidden when certain values are picked from a dropdown menu. The row seems to hide but still leaves the text box showing. I can't seem to figure out what I'm doing wrong that it won't hide the text box also.
Code:
<script type="text/javascript">
function displayRow(temp,temp1,temp2){
var row = document.getElementById(temp1);
//alert(temp);
//alert(temp1);
//alert(temp2);
if (temp.selectedIndex==3||temp.selectedIndex==5)
{row.style.display = 'none';
temp2.style.visibility='hidden';
}
else
{row.style.display = '';
temp2.style.visibility='visible';
}
}
</script>
Code:
<form action="step2.asp" method="post" name="form" onSubmit="return validateForm();" class="MyForm">
...
...
<tr>
<td><div align="right">Reg Category</div></td>
<td><select name="x1_1" onchange="displayRow(this,'HidRow1','Number_1');" class="text">
<option value="1">A</option>
<option value="1">A</option>
<option value="1">A</option>
<option value="1">A</option>
<option value="1">A</option>
<option value="1">A</option>
</select>
</td>
</tr>
<tr>
<td id="HidRow1" align="right">Membership Number</td>
<td align="left"><input type="text" name="Number_1" maxlength="10" class="text" /></td>
</tr>
...
...