Javascript Help

I have a radio button field with values 1-6. I have successfully written LS to perform a For/Next loop as many times as the number selected in the field.

Here’s a small sample of my code:

If doc.JobNoTechDocs(0) >< “” Then

 For n = 1 To Cint(doc.JobNoTechDocs(0))

   remotedoc.RSAreaName = doc.getItemValue("RSAreaName"+Cstr(n))(0)

 Next

End If

Each of the numbers selected in the radio button field represents a separate tab on the form and each tab contains the same fieldnames with the # appended to each name.

For example: RSAreaName1 or RSAreaName2 or RSAreaName3, etc.

I would like to add validation for certain fields on each of the tabs using the same looping concept I used above, but written in Javascript instead. However, I’m not sure how to do this. Any ideas?

Subject: Javascript Help

how about something like. . .

// to determine what radio btn was chosen

f=document.forms[0]

var choice = “”

for(i=0; i<f.JobNoTechDocs.length; i++){

if(f.JobNoTechDocs[i].checked) choice = f.JobNoTechDocs[i].value;

}

// then add to your validation routine

if(document.getElementById(“RSAreaName”+choice).value == “”) return false