-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.js
74 lines (57 loc) · 2.06 KB
/
functions.js
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
$(document).ready(function() {
$(".features-btn a").click(function(e) {
e.preventDefault();
var dataTarget = $(this).attr("data-target");
$(".tab-content").hide();
$("[id='" + dataTarget + "']").css('display', 'flex');
});
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 20) {
$('.header-wrapper-top').addClass("scroll");
} else {
$('.header-wrapper-top').removeClass("scroll");
}
}
$(".footer-scroll").click(function(){
topFunction();
});
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
// FORM VALIDATION
$(".user-request-form").submit(function(e){
e.preventDefault();
var first_name = e.target.firstName.value;
var last_name = e.target.lastName.value;
var user_email = e.target.email.value;
var user_phone = e.target.phone.value;
var program_of_interest = e.target.programOfInterest.value;
var program_delivery_type = e.target.programDeliveryType.value;
var preferred_communication_type = e.target.preferredCommunicationType.value;
if(first_name.length <= 3) {
alert("JS VALIDATION ALERT: FIRST NAME SHOULD BE MORE THAN 3");
return false;
} else if (last_name <= 3 ) {
alert("JS VALIDATION ALERT: LAST NAME SHOULD BE MORE THAN 3");
return false;
} else if (user_phone <= 9 ) {
alert("JS VALIDATION ALERT: PHONE SHOULD BE MORE THAN OR EQUAL 10");
return false;
} else if (program_of_interest == false ) {
alert("JS VALIDATION ALERT: Please Select Program of interest");
return false;
}else if (program_delivery_type == false ) {
alert("JS VALIDATION ALERT: Please Select Program Delivery Type");
return false;
}else if (preferred_communication_type == false ) {
alert("JS VALIDATION ALERT: Please Select Preferred Communication Type");
return false;
} else {
alert("Thank you for submitting the details, you will be redirected to netsolutions.com");
window.location.href = "https://www.netsolutions.com/";
}
})
// FORM VALIDATION
})