Page is a not externally linkable
cmarshall - 10:55 pm on Mar 13, 2007 (gmt 0)
It's not OnLoad. I just did a test with the code at the end of this reply, and nothing changes. If OnLoad were being called, there would be either only one, or an extra button. (Mac FF2). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Test</title>
<script type="text/javascript">
// <![CDATA[
function CreateANewButton(in_old){
if ( typeof ( in_old )!= 'undefined' ) {
in_old.disabled=true;
in_old.value="Spent";
}
var divvie = document.getElementById('next');
divvie.id = '';
var newbutton = document.createElement('input');
newbutton.type = "button";
newbutton.value = "Create New";
newbutton.onclick = new Function ('CreateANewButton(this);');
divvie.appendChild(newbutton);
var newdiv = document.createElement('div');
newdiv.id = "next";
divvie.parentNode.appendChild(newdiv);
}
// ]]>
</script>
</head>
<body onload="CreateANewButton()">
<div>
<form id="test" action="#" method="get">
<div id="form_container">
<div id="next"></div>
</div>
</form>
</div>
</body>
</html>