-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
44 lines (43 loc) · 1.07 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<html>
<head>
<meta charset="UTF-8">
<title>InputFilter</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="./js/input-filter.js"></script>
</head>
<body>
<div class="col-md-offset-4 col-md-4">
<input id="filter" type="text" class="form-control">
</div>
<script>
(function(){
/* var doc=document;
function eventHandler(event){
var event=event||window.event;
value=this.value;
if (!/^[1-9]\d*$/.test(value)&&value!=="") {
this.value = value.replace(/[^\d]+/g, "");
console.info("good");
return false;
}
console.info("good");
}
var target=doc.getElementById("filter");
target.attachEvent("onpropertychange", function(event) {
return eventHandler.call(target,event);
});*/
var count=0;
$("#filter").inputFilter({
type:"alnum",
transform:"uppercase",
//max:1000,
length:10,
valueChange:function(element,value){
console.info(value);
}
});
}());
</script>
</body>
</html>