I have a form with a bunch of text boxes named the same with a sequential number. ex. answer1, answer2, answer3 etc. I want to check to make sure a value is put in each field an easier way than putting a line of JS for each text box. Is there a way to build the field name dynamically? I've tried several things but keep getting syntax errors. The code is one of my attempts to do this.
function checktextboxes{
for (var x=1; x< 50, x++)
{
if (document.form1.answer'x'.value == null){
alert ("error")
break}}}
Also, I may want use the routine later to check to see if the value of one text box is the same as another text box, so the solution would need to do more than check null.