Hi. I have a form where I want to be able to add two consecutive fields for five times.
But it is complaining about this line: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>
Looks like it is not correct to write those field names before the input tag. If not, how should that be done?Code:document.getElementById('text').innerHTML += "<br>Name: <input type='text' name='name' /><br />Email: <input type='text' name='email' /><br>";
Thanks in advance.


Reply With Quote

Bookmarks