Hi everyone, I'm a relative newcomer to this but I do know some stuff! I'm trying to do something that looks really simple but I can't understand why it's not working. I want to get another <TR> to appear within a table when a link is clicked. I've scripted it out already but can't get it to work. Whenever I click the link, it blanks the page off rather than adding to the current table I am in. The code is below. Any ideas would be much appreciated. Thanks so much.
<HTML>
<BODY>
<TABLE>
<TR>
<TD>
<TABLE>
<TR>
<TD> Staff1 </TD>
<TD> Rob Bishop </TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<!-- <TABLE> <TR> <TD> Staff2 </TD> <TD> Tom Archer </TD> </TR> </TABLE> -->
<script language="Javascript">
var _checked=false;
function boxClicked()
{_checked = !_checked;
if (_checked)
{
var rt="<TABLE> <TR> <TD> Staff2 </TD> <TD> Tom Archer </TD> </TR> </TABLE>";
//alert(rt);
document.write(rt);
}
else
{
var rt="";
//alert(rt);
}
}
</script>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript:boxClicked()"> Add Another Staff Member </a>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<HTML>
<BODY>
<TABLE>
<TR>
<TD>
<TABLE>
<TR>
<TD> Staff1 </TD>
<TD> Rob Bishop </TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<!-- <TABLE> <TR> <TD> Staff2 </TD> <TD> Tom Archer </TD> </TR> </TABLE> -->
<script language="Javascript">
var _checked=false;
function boxClicked()
{_checked = !_checked;
if (_checked)
{
var rt="<TABLE> <TR> <TD> Staff2 </TD> <TD> Tom Archer </TD> </TR> </TABLE>";
//alert(rt);
document.write(rt);
}
else
{
var rt="";
//alert(rt);
}
}
</script>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript:boxClicked()"> Add Another Staff Member </a>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>