Accumulate [JS]-js to get the minimum value in the text box

Source: Internet
Author: User

JS: Get the minimum value in the text box

Effect: Minimum value

Event: After the input value, obtain the minimum value.

Code:

 1   /*  Minimum value of a single block  */  2               Function  Gettbqdzxz (){  3                   VaR Tbkyqd1 = changefloat ($ ("# <% = tbkyqd1.clientid %>" ). Val ());  4                   VaR Tbkyqd2 = changefloat ($ ("# <% = tbkyqd2.clientid %>"). Val ());  5                   VaR Tbkyqd3 = changefloat ($ ("# <% = tbkyqd3.clientid %>" ). Val ());  6                   VaR Tbkyqd4 = changefloat ($ ("# <% = tbkyqd4.clientid %>" ). Val ());  7                   VaR Tbkyqd5 = changefloat ($ ("# <% = tbkyqd5.clientid %>" ). Val ());  8   9                   If (Tbkyqd1! = 0 & tbkyqd2! = 0 & tbkyqd3! = 0 & tbkyqd4! = 0 & tbkyqd5! = 0 ){  10                       VaR Numbers = [Tbkyqd1, tbkyqd2, tbkyqd3, tbkyqd4, tbkyqd5];  11 Numbers = numbers. Sort ( Function  (A, B ){  12                           Return A- B;  13   });  14 $ ("# <% = Tbqdzxz. clientid %>"). Val (numbers [0 ]);  15   }  16                   Else  {  17 $ ("# <% = Tbqdzxz. clientid %>"). Val ("" );  18   }  19   }  20   21  Function  Changefloat (data ){  22               If (Data! = Null & Data! = "" )  23                   Return  Parsefloat (data );  24               Else  25                   Return 0 ;  26 }

 

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.