Bug i FireFox??
Jeg har har lavet et lille script, til at oprette form felter insat i en tabel, dynamisk, scriptet virker fint i ie og opera men ikke i FF, de mystiske er at hvis man laver en Ctrl a på siden og smider det over i feks Frontpage, så ligger formen der, den vises blot ikke i FF.html siden:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1;">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="dk">
<title>Form test</title>
</head>
<script language="JavaScript1.2" src="form.js" type="text/javascript"></script>
<script type="text/javascript">
function start()
{
var cont = document.getElementsByTagName("body")[0];
oForm = new eForm();
myForm = oForm.formType("get","index.php","formNavn");
oForm.inputType("text","inputNavn","værdi","Label text");
oForm.inputType("submit","oSubmit","Submit","");
cont.appendChild(myForm);
}
onload=start;
</script>
<body>
</body>
</html>
------------------------
Form scriptet:
// eForm = new eForm();
// eForm.tabel = true/false;
var eForm = function(){
}
// eForm.formType("POST:GET","index.php","formNavn");
eForm.prototype.formType = function( methodValue, actionValue, nameValue)
{
this.formObj = document.createElement("form");
this.formObj.setAttribute("action",actionValue);
this.formObj.setAttribute("name",nameValue);
this.formObj.setAttribute("method",methodValue);
this.table = document.createElement("table");
this.table.id ="noteTable";
this.tablebody = document.createElement("tbody");
this.tablebody.appendChild(this.formObj);
this.table.appendChild(this.tablebody);
return this.table;
}
// eForm.inputType("text:hidden:file:checkbox:radio:button:submit:reset:image","inputNavn","værdi","Label text");
// eForm.inputObj.tabindex = 1;
eForm.prototype.inputType = function(typeValue, nameValue, valueValue, label)
{
this.inputObj = document.createElement("input");
this.inputObj.setAttribute("type",typeValue);
this.inputObj.setAttribute("name",nameValue);
this.inputObj.setAttribute("id",nameValue);
this.inputObj.value=valueValue;
this.tr = document.createElement("tr");
this.td1 = document.createElement("td");
this.oText = document.createTextNode(label);
this.label = document.createElement("label");
this.label.appendChild(this.oText);
this.label.setAttribute("for",nameValue);
this.td1.appendChild(this.label);
this.tr.appendChild(this.td1);
this.td2 = document.createElement("td");
this.td2.appendChild(this.inputObj);
this.tr.appendChild(this.td2);
this.formObj.appendChild(this.tr);
return this.tr;
}