Hi. I have a form where I want to be able to add two consecutive fields for five times.

Code:
<script language="javascript">
fields = 0;
function addInput() {
if (fields != 5) {
document.getElementById('text').innerHTML += "<br>Name: <input type='text' name='name' /><br />Email: 
<input type='text' name='email' /><br>";
fields += 1;
} else {
document.getElementById('text').innerHTML += "<br />Olny five participants allowed. Thank you.";
document.form.add.disabled=true;
}
}
</script>
But it is complaining about this line:
Code:
document.getElementById('text').innerHTML += "<br>Name: <input type='text' name='name' /><br />Email: 
<input type='text' name='email' /><br>";
Looks like it is not correct to write those field names before the input tag. If not, how should that be done?

Thanks in advance.