Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
birthbaum authored Apr 3, 2022
1 parent d5577e9 commit 3f6e7ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 9 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
<body>

<div id="app"></div>
<button id="btn">You should click me</button>
<button id="btn2">Add row</button>
<form id="form1">
<input type="text" id="inputfname">

First: <input type="text" id="inputfname"><br>
Gender: <input type="text" id="inputgender"><br>
GradeLevel:<input type="text" id="inputgl"><br>
State: <input type="text" id="inputstate"><br>
Major: <input type="text" id="inputmajor"><br>
Extracurricular Activity: <input type="text" id="inputext"><br>
</form>
<button id="btn">You should click me</button>
<button id="btn2">Add row</button>


<script src="my.js"></script>

Expand Down
8 changes: 7 additions & 1 deletion my.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ function testGS(){
const url = "https://script.google.com/macros/s/AKfycbwy8Zc4zEvICVHr-dKe0E9IeYbNDBzPTjMqFSlfBQ_3T67kXUntCz86NMc8i2zK5iEO1g/exec";

fName = document.getElementById("inputfname").value;
fGender = document.getElementById("inputgender").value;
fGrade = document.getElementById("inputgl").value;
fState = document.getElementById("inputstate").value;
fMajor = document.getElementById("inputmajor").value;
fExt = document.getElementById("inputext").value;


fetch(url,{
method: 'POST',
Expand All @@ -25,7 +31,7 @@ function testGS(){
'Content-Type': 'application/json'
},
redirect: 'follow',
body: JSON.stringify({"Student Name":fName,"Gender":"Male","Class Level":"4. Senior","State":"IL","Major":"Math","Extracurricular Activity":"Business Intelligence"})
body: JSON.stringify({"Student Name":fName,"Gender":fGender,"Class Level":fGrade,"State":fState,"Major":fMajor,"Extracurricular Activity":fExt})
});

}
Expand Down

0 comments on commit 3f6e7ad

Please sign in to comment.