There are 5 text Columns

Source: Internet
Author: User

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">





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.