-
Notifications
You must be signed in to change notification settings - Fork 1
/
form.html
351 lines (329 loc) · 14.3 KB
/
form.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bank</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="skins/minimal/minimal.css" rel="stylesheet">
<link rel="stylesheet" href="css/nice-select.css">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="top">
<div class="container">
<div class="menu-bar pull-left">
<a href="index.html" class="logo">Bank</a>
<ul class="menu">
<li><a href="about.html">ABOUT US</a></li>
<li><a href="how-it-works.html">HOW IT WORKS?</a></li>
<li><a href="faq.html">FAQ</a></li>
<li><a href="form.html">CONTACT US</a></li>
</ul>
</div>
<div class="social-icons pull-right">
<ul class="social-icons">
<li><a href="#" class="facebook-top">Facebook</a></li>
<li><a href="#" class="twitter-top">Twitter</a></li>
<li><a href="#" class="linkedin-top">Linkedin</a></li>
<li><a href="#" class="blogger-top">Blogger</a></li>
</ul>
<a href="#" class="font-change increase-size">+</a>
<a href="#" class="font-change decrease-size">-</a>
</div>
</div>
</div>
<div class="top-bg-v2">
<div class="container">
<div class="row">
<div class="col-md-2 col-md-offset-2">
<h2>CONTACT</h2>
<p><strong>eCapital Inc.</strong> <br /><br />
861 6th Ave <br />
Ste 612 <br />
San Diego, CA 92101 <br /><br />
<a href="mailto:contact@ecapital.com">contact@ecapitalinc.com</a><br />
<a href="#">858-34LOANS <br />(858-345-6267)</a></p>
</div>
<div class="col-md-8">
<h2>PRE-QUALIFICATION LOAN APPLICATION</h2>
<form id="formLead">
<div class="form">
<span class="circle-header">1</span>
<h3>Loan Information</h3>
<div class="form-box">
<div class="select-label">
<label><input type="radio" name="trust-deed" id="trust-deed" value="1st" checked>First trust deed</label>
<label><input type="radio" name="trust-deed" id="trust-deed" value="2nd">Second trust deed</label>
</div>
<label>
Amount requested
<input type="text" name="requestedLoanAmount" id="requestedLoanAmount"/>
</label>
<div class="select-label">
What is this loan for?
<select name="whatIsThisLoanFor">
<option value="Acquisition">Acquisition</option>
<option value="Refinance">Refinance</option>
<option value="Bridge loan">Bridge loan</option>
<option value="Fix & flip">Fix & Flip</option>
</select>
</div>
<div class="select-label">
Property Type
<select name="propertyType">
<option value="Single Family Residence">Single Family Residence</option>
<option value="Multifamily">Multifamily</option>
<option value="Retail">Retail</option>
<option value="Industrial">Industrial</option>
<option value="Office">Office</option>
<option value="Land">Land</option>
<option value="Other">Other</option>
</select>
</div>
<label>
Estimated Current Debt Balance (1st)
<input type="text" name="estimatedCurrentDebtBalance1st" id="estimatedCurrentDebtBalance1st"/>
</label>
<label id="estimatedCurrentDebtBalance2ndContainer">
Estimated Current Debt Balance (2nd)
<input type="text" name="estimatedCurrentDebtBalance2nd" id="estimatedCurrentDebtBalance2nd"/>
</label>
<label>
Property Address
<input type="text" name"propertyAddress" id="propertyAddress" />
</label>
<label>
City
<input type="text" name="propertyCity" id="propertyCity" />
</label>
<label>
Zip
<input type="text" name="propertyZip" id="propertyZip" />
</label>
<span class="small-text">Please note that we currently lend only in California.</span>
</div>
<span class="circle-header">2</span>
<h3>Applicant Information</h3>
<div class="form-box">
<label>
First Name
<input type="text" name="firstName" id="firstName" />
</label>
<label>
Last Name
<input type="text" name"lastName" id="lastName" />
</label>
<div class="select-label">
<span>Owner Occupied?</span>
<label><input type="radio" name="ownerOccupied" id="ownerOccupied" value=true>Yes</label>
<label><input type="radio" name="ownerOccupied" id="ownerOccupied" value=false checked>No</label>
</div>
<div class="owner-occupied-message">
<p>We're not lending money on owner occupied estates.</p>
</div>
<label>
Email
<input type="text" name="email" id="email"/>
</label>
<label>
Phone
<input type="text" name="phone" id="phone"/>
</label>
<div class="select-label">
<span>Are you a Broker or Borrower?</span>
<label><input type="radio" name="brokerOrBorrower" value"Broker">Broker</label>
<label><input type="radio" name="brokerOrBorrower" value="Borrower" checked>Borrower</label>
</div>
<div class="select-label">
<span>Do You Own More Than One Investment Property?</span>
<label><input type="radio" name="ownMoreThanOneInvestmentProperty" value=true>Yes</label>
<label><input type="radio" name="ownMoreThanOneInvestmentProperty" value=false checked>No</label>
</div>
<div>
<label>Comments
<input type="text" name="comments" />
</label>
</div>
</div>
<button type="submit">SUBMIT</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="contact-bar">
<div class="container">
<div class="row">
<div class="col-sm-6">
<p>861 6th Ave <br />
Ste 612 <br />
San Diego, CA 92101</p>
</div>
<!--<div class="col-sm-3">
<h4>Postal Address</h3>
<p>PO Box 16122 Collins Street <br />
Victoria 8007 Australia</p>
</div>-->
<div class="col-sm-6 text-right">
<h4>Contact Our Agent Now!</h4>
<span class="big-text">858-34LOANS <span>(858-345-6267)</span></span>
</div>
</div>
</div>
</div>
<div class="footer-links">
<div class="container">
<div class="row">
<div class="col-sm-4">
<a href="#" class="footer-logo">Bank</a>
<p>eCapital. Real estate loans for investors. Hard Money Loans, Loans with no credit checks. Loans with no tax returns, Loans without income verification. <br /> We also lend against luxury assets, click <a href="#">here to learn more</a></p>
</div>
<div class="col-sm-4 helpful-links">
<h4>HELPFUL LINKS</h4>
<ul>
<li><a href="#">Apply Now</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Company news</a></li>
</ul>
</div>
<div class="col-sm-4">
<h4>SOCIAL</h4>
<ul>
<li><a href="#">Yelp</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">LinkedIn</a></li>
<li><a href="#">Facebook</a></li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="container">
<p>ECAPITAL 2016 © / ALL RIGHTS RESERVED</p>
<ul class="social-links-bottom pull-right">
<li><a href="#" class="linkedin-bottom">Linkedin</a></li>
<li><a href="#" class="facebook-bottom">Facebook</a></li>
<li><a href="#" class="google-bottom">Google+</a></li>
<li><a href="#" class="twitter-bottom">Twitter</a></li>
<li><a href="#" class="youtube-bottom">Youtube</a></li>
</ul>
</div>
</footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/jquery.nice-select.js"></script>
<script src="js/icheck.min.js"></script>
<script src="js/jquery.mask.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
function getFormData($form){
var unindexed_array = $form.serializeArray();
var indexed_array = {};
$.map(unindexed_array, function(n, i){
if(n['value'] == "true") n['value'] = true;
if(n['value'] == "false") n['value'] = false;
indexed_array[n['name']] = n['value'];
});
return indexed_array;
}
$(document).ready(function() {
$('select').niceSelect();
$(".form-message").hide();
$(".form button").click(function(){
$(".form-message").fadeIn(1000);
});
$(".owner-occupied-message").hide();
$('input:radio[name="ownerOccupied"]').on('ifChanged', function(event){
if ($(this).val() == 'true') {
$('.owner-occupied-message').show();
$('button[type="submit"]').attr('disabled','disabled');
}
else {
$('.owner-occupied-message').hide();
$('button[type="submit"]').removeAttr('disabled');
}
});
$('input').iCheck({
checkboxClass: 'icheckbox_minimal',
radioClass: 'iradio_minimal',
increaseArea: '20%' // optional
});
$(".decrease-size").hide();
$(".increase-size").click(function(){
$(this).hide();
$(".decrease-size").show();
$("body").addClass("big-font");
});
$(".decrease-size").click(function(){
$(this).hide();
$(".increase-size").show();
$("body").removeClass("big-font");
});
$('#requestedLoanAmount').mask('000,000,000,000,000', {reverse: true});
$('#estimatedCurrentDebtBalance1st').mask('000,000,000,000,000', {reverse: true});
$('#estimatedCurrentDebtBalance2nd').mask('000,000,000,000,000', {reverse: true});
$('#phone').mask('(000) 000-0000', {placeholder: "(___) ___-____"});
$('#propertyZip').mask('00000');
$('#estimatedCurrentDebtBalance2ndContainer').hide();
$('input:radio[name="trust-deed"]').on('ifChanged', function(event){
if ($(this).val() == '2nd') {
$('#estimatedCurrentDebtBalance2ndContainer').show();
}
else {
$('#estimatedCurrentDebtBalance2ndContainer').hide();
}
});
$( "form").submit(function( event ) {
event.preventDefault();
var dataString = getFormData($("#formLead"));
delete dataString["trust-deed"];
dataString.leadDomain = "ecapitalinc.com";
dataString.leadType = "Web";
dataString.leadStatus = "Lead";
// todo : serializeArray not returning all fields
dataString.lastName = $('#lastName').val();
dataString.propertyAddress = $('#propertyAddress').val();
dataString.phone = $('#phone').cleanVal();
dataString.requestedLoanAmount = $('#requestedLoanAmount').cleanVal();
dataString.estimatedCurrentDebtBalance1st = $('#estimatedCurrentDebtBalance1st').cleanVal();
dataString.estimatedCurrentDebtBalance2nd = $('#estimatedCurrentDebtBalance2nd').cleanVal();
console.log(dataString);
if(dataString.firstName && dataString.lastName && dataString.phone && dataString.email) {
console.log('all set');
} else {
alert('Please fill in all required fields.');
return false;
}
var postUrl = "http://crm-staging.elendinginc.com/methods/createLead";
//var postUrl = "http://localhost:3000/methods/createLead";
$.ajax({
method: "post",
url: postUrl,
data: JSON.stringify(dataString),
contentType: "application/json",
success: function (data) {
console.log(data); // 6
alert('Your information has been forwarded to our agent. Someone will be in contact with you as soon as possible.');
}
});
});
});
</script>
</body>
</html>