<form name="dome" onsubmit="return validateForm()" method="get">
<input type="text" name="comment[]" value="comment1"/>
<input type="text" name="comment[]" value="comment2"/>
<input type="text" name="comment[]" value="comment3"/>
<input type="text" name="comment[]" value="comment4"/>
</form>
I know I can send multiple inputs with the same name and have them save into an array by adding empty square brackets to the input name like in the code.
Now I would like to get the all the values in JavaScript for validation on submit.
I have tried this but it didn't work.
var comment_list = document.forms["dome"]["comment[]"].value;