-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate4.4
More file actions
137 lines (136 loc) · 5.16 KB
/
template4.4
File metadata and controls
137 lines (136 loc) · 5.16 KB
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
<!--
-JPaul Meyer and Jake Morrissey
-template4.php
-
-CS50
-State Compare
-
-template for ideal input form
!-->
<form action="ideal.php" method="post">
<!--http://demosthenes.info/blog/757/Playing-With-The-HTML5-range-Slider-Input !-->
<!-- functions for updating numbers under sliders !-->
<script>
function popoutputUpdate(number)
{
document.querySelector('.popnumber').value = number;
}
function areaoutputUpdate(number)
{
document.querySelector('.areanumber').value = number;
}
function tempoutputUpdate(number)
{
document.querySelector('.tempnumber').value = number;
}
function incomeoutputUpdate(number)
{
document.querySelector('.incomenumber').value = number;
}
function coastoutputUpdate(number)
{
document.querySelector('.coastnumber').value = number;
}
</script>
<fieldset>
</br>
<div>
<?php
// average value for each factor
$apopulation = 6265634;
$aarea = 75885;
$atemp = 51.9;
$aincome = 50473;
$acoast = 251.5;
?>
<div>
<!-- population title !-->
<span class=title>Population</span>
</br>
</br>
<!-- text field for ideal population !-->
Ideal Population:
</br>
<input value=0 name="xpopulation" placeholder="Average: <?php echo($apopulation); ?>" type="text"/>
</div>
</br>
<!-- slider for ranking factor importance !-->
How important is this factor to you?
<input type=range name="ipopulation" value=5 min=0 max=10 id=popfader step=1 onchange="popoutputUpdate(this.value)">
<output for=popfader class=popnumber>5</output>
</br>
</br>
<div>
<!-- area title !-->
<span class=title>Area (square miles)</span>
</br>
</br>
<!-- text field for ideal area !-->
Ideal Area:
</br>
<input value=0 name="xarea" placeholder="Average: <?php echo($aarea); ?>" type="text"/>
</div>
</br>
<!-- slider for ranking factor importance !-->
How important is this factor to you?
<input type=range name="iarea" value=5 min=0 max=10 id=areafader step=1 onchange="areaoutputUpdate(this.value)">
<output for=areafader class=areanumber>5</output>
</br>
</br>
<div>
<!-- temperature title !-->
<span class=title>Average Temperature (°F)</span>
</br>
</br>
<!-- text field for ideal temperature !-->
Ideal Average Temperature:
</br>
<input value=0 name="xtemp" placeholder="Average: <?php echo($atemp); ?>" type="text"/>
</div>
</br>
<!-- slider for ranking factor importance !-->
How important is this factor to you?
<input type=range name="itemp" value=5 min=0 max=10 id=tempfader step=1 onchange="tempoutputUpdate(this.value)">
<output for=tempfader class=tempnumber>5</output>
</br>
</br>
<div>
<!-- income title !-->
<span class=title>Median Household Income</span>
</br>
</br>
<!-- text field for ideal income !-->
Ideal Income:
</br>
<input value=0 name="xincome" placeholder="Average: <?php echo($aincome); ?>" type="text"/>
</div>
</br>
<!-- slider for ranking factor importance !-->
How important is this factor to you?
<input type=range name="iincome" value=5 min=0 max=10 id=incomefader step=1 onchange="incomeoutputUpdate(this.value)">
<output for=incomefader class=incomenumber>5</output>
</br>
</br>
<div>
<!-- coastline title !-->
<span class=title>Coastline (miles)</span>
</br>
</br>
<!-- text field for ideal coastline !-->
Ideal Coastline:
</br>
<input value=0 name="xcoast" placeholder="Average: <?php echo($acoast); ?>" type="text"/>
</div>
</br>
<!-- slider for ranking factor importance !-->
How important is this factor to you?
<input type=range name="icoast" value=5 min=0 max=10 id=coastfader step=1 onchange="coastoutputUpdate(this.value)">
<output for=coastfader class=coastnumber>5</output>
</div>
</br>
<div>
<!-- submit button !-->
<button type="submit">Go!</button>
</div>
</fieldset>
</form>