longmatch
Programmer
- Nov 1, 2001
- 406
I found a piece of code on the web, which can be used in my program. Initially I want to hide one row in the table. Once the user select 'other', the hidden row should show up, which include a textbox for user input. How can I make it work. This piece of code just works fine through checkbox. I would like to use dropdown list activate it.
Thanks
Haijun
<html>
<head>
<title>Hide Row</title>
<script language="JavaScript">
function toggle(target)
{
obj=document.getElementById(target);
obj.style.display=( (obj.style.display=='none') ? '' : 'none');
}
</script>
</head>
<body>
<input style="display:inline" type="checkbox" onClick="toggle('therow')" id=checkbox1 name=checkbox1>
<table>
<tr id="therow" style="display:inline">
<td width="60"><font size="1" face="Arial">6/25/2002</font> </td>
<td width="60" align="right"><font size="1" face="Arial">
<span style='background-color: #C0C0C0'>
<i><u>1.00</u></i>
</span>
</font> </td>
<td width="60" align="right"><font size="1" face="Arial">2</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
</tr>
</table>
</body>
</html>
Thanks
Haijun
<html>
<head>
<title>Hide Row</title>
<script language="JavaScript">
function toggle(target)
{
obj=document.getElementById(target);
obj.style.display=( (obj.style.display=='none') ? '' : 'none');
}
</script>
</head>
<body>
<input style="display:inline" type="checkbox" onClick="toggle('therow')" id=checkbox1 name=checkbox1>
<table>
<tr id="therow" style="display:inline">
<td width="60"><font size="1" face="Arial">6/25/2002</font> </td>
<td width="60" align="right"><font size="1" face="Arial">
<span style='background-color: #C0C0C0'>
<i><u>1.00</u></i>
</span>
</font> </td>
<td width="60" align="right"><font size="1" face="Arial">2</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
<td width="60" align="right"><font size="1" face="Arial">3.00</font> </td>
</tr>
</table>
</body>
</html>