forked from Lucas2308/simple-survey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
134 lines (128 loc) · 5.17 KB
/
index.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
<html>
<head>
<link rel='stylesheet' type='text/css' href='css/index.css'>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="danger">
<p><strong></strong> </p>
</div>
<meta name="viewport" content="width=device-width, initial-scale=1">
<div class="danger">
<strong>
</strong>
</div>
<div class="header">
<div class="left">
<img src="./image.jpg" alt="logo" />
</div>
<div class="right_txt">
PwC Survey
</div>
<div class="both"></div>
</div>
<div class="center back-color">
<body>
<div class="intro">
<h2>Welcome to the Performance engineering survey</h2>
<div class="text">
<h2>We're interested in understanding the ecosystem and archetypes of the coliving movement, in order to make it easier to start and operate coliving houses, and to create a picture of the amazing spectrum of these spaces.
There is more to performance engineering than just testing. Done right, performance engineering means understanding how all the parts of the system fit together, and building in performance from the first design.
</h2>
</div>
<div>
<form class="user-info-form">
<!-- Need to at action and method attributes when database is name -->
<div class="form-group">
<label>*Username: </label>
<input type ="text" name = "username" required class="form-control" >
</div>
<div class="form-group">
<label>*Email:</label>
<input type = "email" class="email-input form-control" name = "email" required >
</div>
<div class="form-group">
<label>*Organization:</label>
<input type = "text" name ="organization" required class="form-control" >
</div>
<div class="form-group">
<label>Mobile Number (optional)</label>
<input type="tel" name = "mobile" class="mobile-num form-control allownumericwithoutdecimal">
</div>
<button type = "button" class="btn btn-default save-user-info" >Save</button>
</form>
<center>
<a href="./FirstPage.html">Take the Survey</a> ||
<a href="./privacy.html">Read the Privacy Statement</a>
</center>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script>
$(document).ready(function(){
$(".save-user-info").click(function(){
var valid = true;
$("input[required]").each(function(){
var v = $(this).val();
if(v.length < 1){
valid = false;
return false;
}
});
var isnum = true;
var mobile = $(".mobile-num").val();
if(mobile.length > 0){
isnum = /^\d+$/.test(mobile);
}
if(!valid || !window.validateEmail($(".email-input")) || !isnum){
alert("not valid");
return;
}
});
window.validateEmail = function(emailInput){
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
validEmail = regex.test(emailInput.val());
if(validEmail){
console.log("valid")
return true;
}else{
//error
console.log("fake news")
return false;
}
}
$(".allownumericwithoutdecimal").on("keypress keyup blur",function (event) {
//$(this).val($(this).val().replace(/[^\d].+/, ""));
// console.log(event.which)
var dashAllowed = 0; //default, don't allow dashes
if($(this).hasClass("phonenumber")){
dashAllowed = 45;
}
var fowardslashAllowed = 0; //default, don't allow forward slash
if($(this).hasClass("mmyy")){
// console.log($(this).val().length)
if (event.keyCode != 8){ //gaurd against backspaces
if($(this).val().length === 2){
fowardslashAllowed = 47;
if (event.keyCode != 47){ //in case they enter slash themself
var thisVal = $(this).val();
thisVal += '/';
$(this).val(thisVal);
}
}
}
}
// console.log("event.which: " + event.which)
//allow tabs! (needed for firefox)
if (event.which !== 8 && event.which !== dashAllowed && event.which!==0 && event.which !== fowardslashAllowed) { //backspace, dash, tab, forward slash
if ((event.which < 48 || event.which > 57)) {
event.preventDefault();
}
}
});
});
</script>
</html>
</body>