Shecky
01-24-2005, 10:21 AM
I'm trying to make a form where, when a button is clicked, it adds another field for data entry. I need this to work with IE and Firefox. As it seems innerHTML works with firefox, my first instinct was to try that, however it reacts a bit differently in firefox (it clears previous fields when a new field is added.)
<html>
<head>
<script>
function addrow(){
form1.innerHTML += "<input type='text'><br>";
}
</script>
</head>
<body>
<form id="form1">
<input type='text'><br>
</form>
<button onclick="addrow()">Add Row</button>
</body>
</html>
Anyhoo... it doesn't have to be innerHTML, either... just has to work with IE and FF. What is a good way to do this?
<html>
<head>
<script>
function addrow(){
form1.innerHTML += "<input type='text'><br>";
}
</script>
</head>
<body>
<form id="form1">
<input type='text'><br>
</form>
<button onclick="addrow()">Add Row</button>
</body>
</html>
Anyhoo... it doesn't have to be innerHTML, either... just has to work with IE and FF. What is a good way to do this?