JS Precision Control

Source: Internet
Author: User

The front-end is used to control the data type of the input box, there are two data types, shaping with the decimal type, adding the lost focus event, can easily achieve the validation of the data.

Sh_decimal (Input)

Contents

    • Sh_decimal (Input)
      1. Obj
      2. _type
      3. _default
      4. HTML code
      5. Fun_blur ()
obj

Input Box Object

_type

Type (int (integral type)/decimal)

_default

Default value

HTML code

< Head >

< title ></ title >

< href rel = "stylesheet" type = "Text/css" />

& nbsp;   script SRC type Span style= "color:blue;" >= "Text/javascript" ></ script >

& nbsp;   script SRC type = "Text/javascript" ></ script >

& nbsp;   script SRC type = "Text/javascript" ></ script >

<script src= "download.js" type= "Text/javascript" ></script>

</ Head >

< >

& nbsp;   font > amount :</ class = "txt or_pay" type = "text" maxlength = " value = "0.00" />

</ Body >

Fun_blur ()

Lost Focus Event

Example:

New Sh_decimal ({
Obj: $ ('. Or_pay '),
Type: ' Decimal ',
Def_txt: ' 0.00 ',
Fun_blur:function () {
Alert ("Lost Focus event");
}
});

Display effect:

: http://www.tiaoceng.com/assemblydetail_32.html

JS Precision Control

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.