forked from arcygarcy/hashBrowns
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcal.html
41 lines (41 loc) · 1.54 KB
/
cal.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
<!DOCTYPE html>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function setDefaultDate(){
document.getElementById('cal').valueAsDate = new Date();
}
function onLoad() {
setDefaultDate();
}
function callAwsLambdaFunction() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
document.getElementById("myDiv").innerHTML=xhr.responseText.replaceAll('**', '<br />');
}
}
xhr.open("POST", 'https://l1qlcbpoq9.execute-api.us-west-1.amazonaws.com/default/trialCal', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
var date = document.getElementById("cal").value + ' 00:00:00';
var loca = document.getElementById("loca").value;
xhr.send('date='+date+'&loca='+loca);
console.log(xhr);
}
</script>
<title>Trial Cal</title>
</head>
<body onload="onLoad()">
<h1>Trial Calander</h1>
<label>Trial Date:</label>
<input type="date" id="cal"></input>
<forn>
<label>County:</label>
<select id="loca">
<option value="CCC">CCC</option>
</select>
<br>
<button onclick="callAwsLambdaFunction()">Create Cal</button><br />
<p><div id="myDiv">Enter Date and Court to see Calander</div></p><dr />
</body>
</html>