forked from sfbrigade/liquefaction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsampleDisplayFile.html
55 lines (47 loc) · 1.61 KB
/
sampleDisplayFile.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
<html><head><title>Sample</title></head><body>
<script type="text/javascript">
var found = undefined;
var foundMessage = "<font color='#FF0000'>Block $$$BLOCK$$$, Lot $$$LOT$$$ is in our liquifaction database. Please contact City Planning department to find out what is required.</font>";
var notFoundMessage = "<font color='#009900'>Block $$$BLOCK$$$, Lot $$$LOT$$$ is not in our database as being affected by liquifaction issues at this time.</font>";
function numbersOnly(e)
{
var keynum;
var keychar;
var numcheck;
if(window.event) // IE
{
keynum = e.keyCode;
}
else if(e.which) // Netscape/Firefox/Opera
{
keynum = e.which;
}
keychar = String.fromCharCode(keynum);
numcheck = /\d/;
return numcheck.test(keychar);
}
function test() {
var message = "";
if (found == undefined) {
found = false;
}
if (found == true) {
message = foundMessage;
found = false;
} else {
message = notFoundMessage;
found = true;
}
var results = document.getElementById("results");
results.innerHTML = message;
}
</script>
<table width="200"><tr><td><input onkeydown="return numbersOnly(event)" width="50"/></td><td><input onkeydown="return numbersOnly(event)" /></td></tr>
<tr><td colspan="2"><button onclick="test();">Search</button></td></tr>
<tr><td colspan="2">
<table width="100%" border="1"><tr><td>
<div align="center" id="results">Search records to find out whether your house is affected by liquifaction issues. (Just click on the button multiple times on this sample version to view possible result messages. Boxes will accept number input only -- even Backspace is ignored!)</div>
</td></tr>
</table>
</td></tr></table>
</body></html>