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)
- Obj
- _type
- _default
- HTML code
- 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