Michael Winter wrote:
(snip)
Mike
Thank you for responding.
Here's some code:
function construct_graph _selection_node ()
{
var all = graphset.all; // speed access
var newselnode =
document.forms["formgraphs "]["selectgrap hs"].cloneNode(fals e);
// This will replace the current select node
var nodeforoptions = newselnode; // where the next option (graph) will go
for(var i=0;i<all.lengt h;++i) {
var typ = typeof(all[i]);
switch(typ) {
case "object": // an option (of type Graph)
// options always become children of the current node
var newopt = document.create Element("option ");
newopt.setAttri bute("value",al l[i].getName());
var txt = document.create TextNode(all[i].getName());
newopt.appendCh ild(txt); // won't display without this
nodeforoptions. appendChild(new opt); // add option to the
appropriate node
break;
case "string":
var newopt = document.create Element("optgro up");
newopt.setAttri bute("label",al l[i]);
newselnode.appe ndChild(newopt) ; // groups are always added to the
selection node
odeforoptions = newopt; // but the next option goes here
break;
}
}
var fnode = document.formgr aphs;
fnode.replaceCh ild(newselnode, fnode.selectgra phs);
}
The culprit is the replaceChild call, which causes a scroll to top.