There are five text columns below. All I need to do is check that the values in the five text Columns cannot be the same.
1 [1] |
2 [1] |
3 [1] |
4 [1] |
5 [1] |
1 [2] |
2 [2] |
3 [2] |
4 [2] |
5 [2] |
|
|
|
|
|
|
|
|
|
|
Is there a better comparative method.
RequiredJSWrite.
My check method is as follows:
// 1And2
If (1 = 2 ){
Window. Alert ("1And2Not the same!! ");
Return false;
}
// 1And3
If (1 = 3 ){
Window. Alert ("1And3Not the same!! ");
Return false;
}
// 1And4
If (1 = 4 ){
Window. Alert ("1And4Not the same!! ");
Return false;
}
// 1And5
If (1 = 5 ){
Window. Alert ("1And5Not the same!! ");
Return false;
}
// 2And3
If (2 = 3 ){
Window. Alert ("2And3Not the same!! ");
Return false;
}
// 2And4
If (2 = 4 ){
Window. Alert ("2And4Not the same!! ");
Return false;
}
// 2And5
If (2 = 5 ){
Window. Alert ("2And5Not the same!! ");
Return false;
}
// 3And4
If (3 = 4 ){
Window. Alert ("3And4Not the same!! ");
Return false;
}
// 3And5
If (3 = 5 ){
Window. Alert ("3And5Not the same!! ");
Return false;
}
// 4And5
If (4 = 5 ){
Window. Alert ("4And5Not the same!! ");
Return false;
}
========================================================== ================
ModifiedAlgorithm
<HTML>
<SCRIPT>
Function (){
Len = 5;
for (I = 0; I for (j = I + 1; j first = eval ("document. ff. t "+ I);
second = eval (" document. ff. t "+ J);
If (first. value! = "" & Second. value! = "" & Second. value = first. value) {
K = I + 1; H = J + 1; alert ("item" + K + "cannot be equal to item" + H + ")}
}< BR >}< br>
"T2">