get form element by using local variable in javascript function.
I need something like this..
function validateTxnProperties()
for (i = 1; i < 37; i++) {
if(checkMaxLength(document.formCollection.otherDocument<%=i%>Comments)){
return false;
}
}
}
I need to replace below code with for loop.
if(checkMaxLength(document.formCollection.otherDocument1Comments)){
return false;
}
if(checkMaxLength(document.formCollection.otherDocument2Comments)){
return false;
}
......
if(checkMaxLength(document.formCollection.otherDocument36Comments)){
return false;
}
Please update the question if i use wrong terms.
document.formCollection["otherDocument"+i+"Comments"]