-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.html
More file actions
108 lines (73 loc) · 3.35 KB
/
example.html
File metadata and controls
108 lines (73 loc) · 3.35 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Credit Card Validator</title>
<meta name="description" content="">
<meta name="author" content="">
<style type="text/css">
* {font-family:Arial, Verdana, sans-serif;}
a { font-weight:bold;color:inherit; }
ul {margin:0;padding:0;}
.wrapper { font-size:0.7em;width:400px;margin:0 auto;padding:.4em; }
#container { background:#f9f9f9;border:3px solid #eee;border:3px solid rgba(0,0,0,0.05);border-radius:5px; }
#header { background:#aaa;background:rgba(0,0,0,0.5);color:#fff; padding:0.4em;font-size:0.8em;text-align:center;border-radius:5px; }
.results {display:block; padding:0.4em 0;}
#main {padding:0.2em;}
#ccnum { outline: none;padding:0.7em;width:94%;border:2px solid #ddd;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
#ccnum:focus { border:2px solid #aaa;}
#cchint {color:#aaa;padding:0.4em 0 0 0;margin:0.5em 0 0 0.2em;font-weight:bold;font-size:11px;}
#validate { display:block;width:100%;padding:0.5em;margin-top:1em;}
#footer { color:#ccc; font-size:11px;}
#acceptedcards {padding:0.4em;}
#acceptedcards li {float:left;list-style:none;}
#cc_errormsg {display:block; width:300px; padding:0.4em 0 0 0;margin:0.5em 0 0 0;font-weight:bold;color:#dd3c10;}
#ccnum.error { background-color:#ffebe8;border:2px solid #dd3c10;}
#ccnum.valid { background-color:#e8ffec;border:2px solid #10dd28;}
.hidden {display:none;}
</style>
</head>
<body>
<div id="container" class="wrapper">
<div id="header">
<h1>Enter your credit card number</h1>
</div>
<form name="ccvaldator">
<p style="color:#666;margin:1em 0 -1em 0.8em;font-size:10px;">WE ACCEPT</p>
<ul id="acceptedcards">
<li class="cc_visa"><img src="1333652765_visa.png" alt="" /></li>
<li class="cc_mastercard"><img src="1333652766_mastercard.png" alt="" /></li>
<li class="cc_amex"><img src="1333652746_american_express.png" alt="" /></li>
<li class="cc_discover"><img src="1333652763_discover.png" alt="" /></li>
<li class="cc_dinersclub"><img src="1333652751_diners_club.png" alt="" /></li>
<li class="cc_jcb"><img src="1333652770_jcb.png" alt="" /></li>
</ul>
<div id="main">
<input type="text" name="ccnum" id="ccnum" size="60" />
<p id="cchint">Eg: 4539534096584, 344874189088886, 5103675894917164</p>
<button id="validate">Validate</button>
</div>
</form>
</div>
<div id="footer" class="wrapper">
Icons by <a href="http://iconshock.com" target="_top">Iconshock.com</a> and regex from <a href="http://www.regular-expressions.info/creditcard.html" target="_top">regular-expressions.info</a>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
<script src="ccvalidator.js"></script>
<script>
$(document).ready(function() {
$("#ccnum").ccvalidator({
'validateon': 'keyup'
});
$("#validate").click(function(e) {
e.preventDefault();
});
});
</script>
</body>
</html>