-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathindex2.html
executable file
·39 lines (31 loc) · 1.21 KB
/
index2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CUSTOM GOOGLE FORM</title>
</head>
<body>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<form id="input-form" action="" method="POST" target="no-target">
<input id="input-q1" placeholder="q1" name="q1">
<input id="input-q2" placeholder="q2" name="q2">
<button id="form-submit" type="submit">SUBMIT</button>
</form>
<p id="input-feedback"></p>
<iframe src="#" id="no-target" name="no-target" style="visibility:hidden"></iframe>
<script>
$('#input-form').one('submit',function(){
var inputq1 = encodeURIComponent($('#input-q1').val());
var inputq2 = encodeURIComponent($('#input-q2').val());
var q1ID = "entry.1872902617";
var q2ID = "entry.1736637257";
var baseURL = 'https://docs.google.com/forms/d/1s0r2Cl5rDGMqD8u08BgUO7lvDrvO9Dr1nm9MsrWxOxQ/formResponse?';
var submitRef = '&submit=Submit';
var submitURL = (baseURL + q1ID + "=" + inputq1 + "&" + q2ID + "=" + inputq2 + submitRef);
console.log(submitURL);
$(this)[0].action=submitURL;
$('#input-feedback').text('Thank You!');
});
</script>
</body>
</html>