forked from harshsingla/tankwarweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.js
More file actions
56 lines (49 loc) · 1.37 KB
/
feedback.js
File metadata and controls
56 lines (49 loc) · 1.37 KB
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
var email;
var name;
var score;
var review;
//var submit= document.querySelector("#submit");
var emot1=document.querySelector("#emot1");
var emot2=document.querySelector("#emot2");
var emot3=document.querySelector("#emot3");
var emot4=document.querySelector("#emot4");
function checkValid()
{
email = document.getElementById('Email');
name = document.getElementById('NAME').value;
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(!filter.test(email.value))
{
alert('Please provide a valid email address');
email.focus;
return false;
}
else if(name.length<=2 || name.length=="" || name.length>20)
{
alert("Please enter a valid Name!");
}
else
{
emot1.addEventListener("click",function()
{ score=1;
});
emot2.addEventListener("click",function()
{ score=2;
});
emot3.addEventListener("click",function()
{ score=3;
});
emot4.addEventListener("click",function()
{ score=4;
});
}
}
function display()
{ email=document.getElementById('Email').value;
name=document.getElementById('NAME').value;
review=document.getElementById('review').value;
console.log("Name of the customer:"+name);
console.log("Email of customer:"+email);
console.log("honest review of customer:"+review);
console.log("honest score of customer:"+score);
}