Dear Users,
I've been trying out with the JavaScript code to hide the textarea when a radio selection-value fulfilled the textarea will hide. So far I can't get the script right; maybe these forum can share me some information to correct my code.
JavaScript function to Hide:
function disable()
{
var radios = document.getElementByTagName("fieldset");
if (radios)
{
var inputs = radios.getElementsByTagName("input");
if (inputs.type == "radio" && inputs.name == "StatusServiceNow" && inputs.value == "1")
{
document.getElementById("txt1").style.visibility="hidden";
}
else
{
document.getElementById("txt1").style.visibility="visible";
}
}
}
For the variable is actually base on the HTML code below:
<fieldset id="radios">
<td width="33" bgcolor="#00FF00" ><font face="Arial"><input type="radio" checked name="ItemName" onclick="disable()" value="1"></font></td>
<td width="33" bgcolor="#FFFF00" ><font face="Arial"><input type="radio" name="ItemName" onclick="enable()" value="2"></font></td>
<td width="33" bgcolor="#FF0000" ><font face="Arial"><input type="radio" name="ItemName" onclick="enable()" value="3"></font></td>
</fieldset>
The code for the text area as below:
<td colspan="6">
<font face="Arial"><textarea id="txt1" rows="8" name="ISSUE" cols="90"><%=ISSUE%>
Thank you.
Warmest Regards,
Bremen