Here is the code may be helpful to you:
In repeater or any asp.net data control generates id as controlId+(_rowsNo) so that you can find all the controls row by row using javascript as below.
In repeater or any asp.net data control generates id as controlId+(_rowsNo) so that you can find all the controls row by row using javascript as below.
var repeaterControl =
document.getElementById("dvRepeater");
var tableControl =
repeaterControl.getElementsByTagName("TABLE");
for (var i = 0; i <
tableControl.length; i++) {
var correctAnswer =
document.getElementById("ContentPlaceHolder1_rptID_txtCorrectAnswer_" + i).value;
if (correctAnswer == "") {
status =
false;
document.getElementById("ContentPlaceHolder1_rptID_txtCorrectAnswer_" + i).style.borderColor = "red";
}
}
No comments:
Post a Comment