I spent several hours struggling with dynamic form fields added with
appendChild or innerHTML not POSTing on submit in Firefox. The only
way I found to make it work is to append any created fields to a DIV
within the form. Here is an example I store from another post. I hope
this helps someone.
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>creati ng input elements dynamically</title>
<script type="text/javascript">
function addInput () {
var div;
if (document.getEl ementById) {
div = document.getEle mentById('hidde nList');
var input;
if (document.creat eElement && (input =
document.create Element('input' ))) {
input.type = 'hidden';
input.name = 'currentDate';
input.defaultVa lue = input.value = new Date().toString ();
div.appendChild (input);
}
}
}
function showQueryString () {
document.write( '<p>location.se arch: ' + location.search + '<\/p>\r
\n');
}
</script>
</head>
<body>
<script type="text/javascript">
showQueryString ();
</script>
<form name="form1" action="test.ph p">
<div id="hiddenList" ></div>
<input type="submit" onClick="addInp ut()">
</form>
</body>
</html>