-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
110 lines (101 loc) · 4.88 KB
/
index.html
File metadata and controls
110 lines (101 loc) · 4.88 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
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8">
<title> Mexican CURP and RFC Test </title>
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- FONT
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link href='http://fonts.googleapis.com/css?family=Raleway:400,300,600' rel='stylesheet' type='text/css'>
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/skeleton.css">
<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="icon" type="image/png" href="images/favicon.png" />
</head>
<body>
<!-- Primary Page Layout
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<div class="container">
<div class="row">
<div class="one-half column" style="margin-top: 25%">
<h4> Mexican Curp and RFC Test </h4>
<form class="pure-form">
<fieldset>
<div>
<label for="first_name"> Name(s) </label>
<input type="text" name="first_name" id="first_name" />
</div>
<div>
<label for="father_surname"> First Surname(Father surname) </label>
<input type="text" name="father_surname" id="father_surname" />
</div>
<div>
<label for="mother_surname"> Second Surname(Mother surname)</label>
<input type="text" name="mother_surname" id="mother_surname" />
</div>
<div>
<label> Born date(dd/mm/yyy)</label>
<input type="text" name="born_date" id="born_date" />
</div>
<div id="born_state_wrapper">
<label for="born_state"> Born State </label>
<select name="born_state" id="born_state">
<option value="" selected>Select one</option>
</select>
</div>
<div>
<label> Gender </label>
<select name="gender" id="gender">
<option value="0"> Female </option>
<option value="1"> Male </option>
</select>
</div>
<button class="button button-primary" id="calculate_button"> Calculate </button>
</fieldset>
</form>
</div>
<div class="one-half column" style="margin-top: 25%">
<h3>Results </h3>
<div>
<label for="rfc-result"> RFC(Federal Taxpayer Register) </label>
<input type="text" id="rfc-result" disabled="disbaled" class="u-full-width"/>
</div>
<div>
<label> CURP (Unique Population Registry Code) </label>
<input type="text" id="curp-result" disabled="disbaled" class="u-full-width"/>
</div>
</div>
</div>
</div>
<script src="src/mxk.js"></script>
<script>
mxk.fillBornStateSelect("born_state");
document.getElementById('calculate_button').addEventListener('click', function(event){
event.preventDefault()
event.stopPropagation()
name = document.getElementById("first_name").value;
father_surname = document.getElementById("father_surname").value;
mother_surname = document.getElementById("mother_surname").value;
born_date = document.getElementById("born_date").value;
born_state = document.getElementById("born_state").value;
gender = document.getElementById("gender").value;
rfc_field = document.getElementById("rfc-result")
curp_field = document.getElementById("curp-result")
born_date = born_date.split('/')
rfc_field.value = mxk.getRFC(name, father_surname, mother_surname, born_date[0], born_date[1], born_date[2], born_state, gender);
curp_field.value = mxk.getCURP(name, father_surname, mother_surname, born_date[0], born_date[1], born_date[2], born_state, gender);
});
</script>
<!-- End Document
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
</body>
</html>