-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeedbackDetails
66 lines (43 loc) · 1.41 KB
/
FeedbackDetails
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
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<h2>Feedback for the ART OF LIVING session</h2>
<table>
<tr>
<td>
Enter the Feedback:
</td>
<td><textarea name="feedback" id=feedback rows="4" cols="40"></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="button" name="create" id="create" value="Add Feedback" onclick="addFeedback();"></td>
</tr>
<tr>
<td colspan="2"><input type="button" name="view" id="view" value="View Feedback" onclick="displayFeedback();"></td>
</tr>
</table>
<div id="result"></div>
<script src="script.js" type="text/javascript"></script>
</body>
</html>
var arr = [];
function addFeedback(){
var feedbackTextArea = document.getElementById("feedback");
var result = document.getElementById("result");
arr.push(feedbackTextArea.value);
feedbackTextArea.value = " ";
result.innerHTML = "<h2>Feedback Details</h2><br>Successfully Added Feedback Details!";
}
function displayFeedback(){
var op = "<h2>Feedback Details</h2>";
var lcv = 1;
for(var element in arr){
op += "Feedback "+lcv.toString()+"<br>" + arr[element] + "<br>";
lcv++;
}
document.getElementById("result").innerHTML = op;
arr = [];
}