-
Notifications
You must be signed in to change notification settings - Fork 551
Expand file tree
/
Copy pathtest.html
More file actions
31 lines (31 loc) · 781 Bytes
/
test.html
File metadata and controls
31 lines (31 loc) · 781 Bytes
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
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="jquery.numeric.js"></script>
</head>
<body>
<form>
Numbers only:
<input class="numeric" type="text" />
Integers only:
<input class="integer" type="text" />
<a href="#" id="remove">Remove numeric</a>
</form>
<script type="text/javascript">
$(".numeric").numeric();
$(".integer").numeric(false, function() { alert("Integers only"); this.value = ""; this.focus(); });
$("#remove").click(
function(e)
{
e.preventDefault();
$(".numeric,.integer").removeNumeric();
}
);
</script>
<br/>
<div>
Allow paste only numbers :ex.: 863 2a783#23af result: 863278323
</div>
</body>
</html>