[thelist] re: checkboxes, DOM, rows, etc

Tom Dell'Aringa pixelmech at yahoo.com
Thu Sep 19 17:04:01 CDT 2002


--- Fernando_Gómez <fgomez at criba.edu.ar> wrote:
> From: "Tom Dell'Aringa" <pixelmech at yahoo.com>
> Sent: Thursday, September 19, 2002 6:38 PM
>
> > Here is the full function I use to add a row:
> > ----------
> > function addDoctor(name, city, id)  //i use id to set id and name
> > {
> > var docTarget = window.frames['docs'].document;
> > var docBody = docTarget.getElementsByTagName("body").item(0);
> > var myTable = docTarget.getElementById('mydocs');
> > var myTableBody = docTarget.createElement("TBODY");
> >
> ...
> > myTableBody.appendChild(row)
> > myTable.appendChild(myTableBody)
> > docBody.appendChild(myTable)
> > }
> > ---------------------
>
>
> Tom:
>
> What about the <form> element? Where does it appear in your
> document tree?
> It looks like it should be a child of the <table>. Is it so?

Ok, the <form> element was indeed OUTSIDE the table. I moved it
inside - it still doesn't work. It alerts me 3 as the length of the
form which is correct at load - 2 checkboxes and a button - but
that's all it ever gives me, so it still seems its not seeing the
added stuff...here is the table:

<table width="100%" border="0" cellspacing="0" cellpadding="2"
id="mydocs">
<form id="seldocsform" name="seldocsform" action="" method="">
<tr bgcolor="#666666">
<td width="16">&nbsp;</td>
<td width="16"><input type="checkbox" id="all" class="checkbox"
onclick="checkAllBoxes(this.form)" /></td>
<td colspan="2"><input type="button" name="delete" value="Delete"
class="button" onmouseover="this.style.background = '#cc0000'"
onmouseout="this.style.background = '#ff6600'" title="Delete all
checked physicians" /></td>
</tr>
<tr>
<td width="16"><img src="view.gif" width="14" height="14" alt=""
/></td>
<td width="16"><input type="checkbox" id="fern"
class="checkbox"></td>
<td><label for="fern">Fernandez, Carlos</label></td>
<td>Neptune, NJ</td>
</tr>
</form>
</table>

Tom



=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



More information about the thelist mailing list