-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSolve.html
230 lines (224 loc) · 11 KB
/
Solve.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>CSW Loans</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<!-- Favicon -->
<link rel="icon" type="img/png" href="Assets/favicon.ico" />
<!-- Custom CSS -->
<link href="Content/styles.css" rel="stylesheet" />
<!-- Favicon -->
<link rel="icon" href="/Assets/favicon.ico" />
<!-- Nav bar css -->
<link href="Content/navbar.css" rel="stylesheet" />
</head>
<body onload="CheckHCR();">
<!-- NAV START -->
<!--</nav>-->
<nav class="navbar navbar-expand-lg bg-dark navbar-dark static-top">
<div class="container">
<!-- Navbar brand -->
<a class="navbar-brand" href="Index.html">CSW Loans</a>
<!-- Collapse button -->
<button class="navbar-toggler third-button" type="button" data-toggle="collapse" data-target="#navbarSupportedContent22"
aria-controls="navbarSupportedContent22" aria-expanded="false" aria-label="Toggle navigation">
<div class="animated-icon3"><span></span><span></span><span></span></div>
</button>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="navbarSupportedContent22">
<!-- Links -->
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="Index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="Solve.html">Solution</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Code.html">Code</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/mackenzieweaver/MortgageCalculator" target="_blank">Github</a>
</li>
</ul>
<!-- Links -->
</div>
<!-- Collapsible content -->
</div>
</nav>
<!-- NAV END -->
<!-- Header -->
<header class="py-5 mb-5">
<div class="container h-100">
<div class="row h-100 align-items-center">
<div id="headertext" class="col-lg-12">
<h1 class="display-4 mt-5 mb-2">Solution</h1>
<p class="lead mb-5">We provide you with an example to use so that you can just click the "Calculate" button to generate an easy to read table. Optionally you can enter in any loan amount, interest rate, and term that you would like. Use the "reset" button to start over.</p>
</div>
</div>
</div>
</header>
<!-- Page Content -->
<div class="container">
<div id="inout" class="row mt-5">
<div id="inputs" class="col">
<div class="row">
<div class="col">
<div class="row mt-5 inputoption text-center">
<div class="col ml-4 pt-3">
<i>Optional:</i>
</div>
</div>
<div class="row inputoption text-right">
<div class="col ml-4">
<i>Price</i>
</div>
<div class="col mr-4">
<input type="text" id="totalPrice" value="$125,000" pattern="^\$\d{1,3}(,\d{3})*(\.\d+)?$" data-type="currency" oninput="DownPayment(this.value, document.getElementById('downPayment').value, document.getElementById('loan').value);" />
</div>
</div>
<div class="row mb-3 inputoption text-right">
<div class="col ml-4 pb-4">
<i>Down</i>
</div>
<div class="col mr-4">
<input type="text" id="downPayment" value="$25,000" pattern="^\$\d{1,3}(,\d{3})*(\.\d+)?$" data-type="currency"
oninput="DownPayment(document.getElementById('totalPrice').value, this.value, document.getElementById('loan').value);" />
</div>
</div>
</div>
</div>
<hr class="mb-4 mr-4 ml-4 mb-4" />
<div class="row mb-3">
<div class="col ml-4">
Loan Amount:
</div>
<div class="col mr-4">
<input type="text" id="loan" value="$100,000" pattern="^\$\d{1,3}(,\d{3})*(\.\d+)?$" data-type="currency" />
</div>
</div>
<div class="row mb-3">
<div class="col ml-4">
Interest Rate:
</div>
<div class="col mr-4">
<input type="text" id="rate" value="3.92" oninput="validateRate(this.value)" />
</div>
</div>
<div class="row mb-3">
<div class="col ml-4">
Term (months):
</div>
<div class="col mr-4">
<input type="number" id="term" value="360" min="1" max="360" oninput="validity.valid||(value='');" />
</div>
</div>
<div id="cbp" class="row mr-4 justify-content-end">
<button id="calcbtn" class="mt-5 btn btn-warning" onclick="Calculate(document.getElementById('loan').value,document.getElementById('term').value,document.getElementById('rate').value)">
Calculate
</button>
</div>
<div class="row mr-4 mb-5 justify-content-end">
<button id="resetbtn" class="btn btn-danger mt-3" onclick="Reset()">
Reset
</button>
</div>
</div>
<div id="outputs" class="col">
<div class="row">
<div id="m1" class="col">
<div id="m2" class="row justify-content-center mt-4">
<h1>Your Monthly Payments</h1>
</div>
<div class="row justify-content-center pt-5 pb-5">
<h1 id="monthlypayment">$0.00</h1>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row">
<div class="col ml-4">
<h3>Total Principal</h3>
</div>
<div class="col">
<div class="row justify-content-end pr-5">
<h3 id="totalprincipal">$0.00</h3>
</div>
</div>
</div>
<div class="row">
<div class="col ml-4">
<h3>Total Interest</h3>
</div>
<div class="col">
<div class="row justify-content-end pr-5">
<h3 id="totalinterest">$0.00</h3>
</div>
</div>
</div>
<div class="row">
<div class="col ml-4">
<h3>Total Cost</h3>
</div>
<div class="col">
<div class="row justify-content-end pr-5">
<h3 id="totalcost" class="mb-5">$0.00</h3>
</div>
</div>
</div>
</div>
</div>
<div id="chart" class="row justify-content-center chart-container mb-4 ml-1 mr-1">
<canvas id="myChart" height="400" width="500" style="display: none"></canvas>
</div>
</div>
</div>
<div id="tablerow" class="row">
<table class="table table-responsive-lg table-dark table-striped mt-4">
<thead>
<tr>
<th scope="col">Month</th>
<th scope="col">Payment</th>
<th scope="col">Principal</th>
<th scope="col">Interest</th>
<th scope="col">Total Interest</th>
<th scope="col">Balance</th>
</tr>
</thead>
<tbody id="tbody">
<tr>
<td scope="col">$0.00</td>
<td scope="col">$0.00</td>
<td scope="col">$0.00</td>
<td scope="col">$0.00</td>
<td scope="col">$0.00</td>
<td scope="col">$0.00</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Footer -->
<footer class="py-5 bg-dark">
<div class="container">
<p class="mb-0 pt-5 text-center text-white">Copyright © CSW Loans 2020 - 2022</p>
</div>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="//code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="//cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<!-- Chart JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js" integrity="sha512-d9xgZrVZpmmQlfonhQUvTR7lMPtO7NkZMkA0ABN3PHCbKA5nqylQ/yWlFAyY6hYgdF1Qh6nYiuADWwKB4C2WSw==" crossorigin="anonymous"></script>
<!-- Custom JS -->
<script src="Scripts/CustomJS.js"></script>
<script src="Scripts/accounting.min.js"></script>
<script src="Scripts/InputFormatting.js"></script>
<!-- Custom JS toggles nav -->
<script src="Scripts/togglenav.js"></script>
</body>
</html>