-
Notifications
You must be signed in to change notification settings - Fork 1
/
fakeform.html
94 lines (89 loc) · 3.18 KB
/
fakeform.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
<html>
<head>
<meta charset='UTF-8'>
<title>
SanHack Reporting
</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="https://d3voyrscnb0slx.cloudfront.net/cartodb.js/v2/cartodb.js"></script>
<style>
.fake-form {height: 220px; width: 100%; padding: 60 0 0 0; margin: 80 0 0 0; border: 12px solid black; font-size: 20px; font-weight: bold; line-height: 28px;}
.fake-form input[type='text'] {font-size: 20px; height: 30px; }
</style>
<script>
var phones = ["453.534.2322","720.279.4174","253.279.4174","314.279.4174","212.279.4174"];
function getFakeNum(){
var n = phones[Math.floor(Math.random()*phones.length)];
$('#num').val(n);
}
function getFakeMsg(){
var m = Math.floor(25*Math.random()) + "m";
var f = Math.floor(25*Math.random()) + "f";
if (Math.random() < 0.2){
$('#msg').val("Good morning!")
} else{
$('#msg').val(f+" "+m)
}
}
function form1Submit() {
var num= encodeURIComponent($('#num').val());
var msg= encodeURIComponent($('#msg').val());
$.ajax({
url: "http://sanhack.johnmarc.org/submit.php?msg="+msg+"&num="+num+"&c=?",
type: 'POST',
async: false,
dataType: "jsonp",
success: function(res) {
alert(res);
}
});
return false;
}
function init(){
getFakeMsg();
getFakeNum();
$('#form1').submit(form1Submit);
}
</script>
</head>
<body onload="init()">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">World Bank Attendance Report</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="#">form</a></li>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<div class="tab">
<label for="tab-2" id="form"></label>
<div class="content">
<div class="row-fluid fake-form">
<div class="span4"></div>
<div class="span4">
<form id="form1">
What is the phone number? <br/>
<input type="text" name="num" id="num" value=""/> <br/>
What is today's attendance? <br/>
<input type="text" name="msg" id="msg" value=""/> <br/>
<input type="submit" value="Submit">
</form>
</div>
<div class="span4"></div>
</div>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</body>
</html>