-
Notifications
You must be signed in to change notification settings - Fork 0
/
review.html
133 lines (113 loc) · 4.36 KB
/
review.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="Style1.css">
<script>
function validateform()
{
var a = document.forms["form1"]["username"];
var b = document.forms["form1"]["Recipelink"];
var c = document.forms["form1"]["image-input"];
var d = document.forms["form1"]["review"];
var e = document.forms["form1"]["Rating"].value;
if (isNaN(e) || e < 1 || e > 10)
{
alert("Rating Not Valid");
e.focus();
return false;
}
if(a.value.length < 5 || a.value.length > 12)
{
alert("Enter a valid Username");
a.focus();
return false;
}
else{
return true;
}
if(b.value=" ")
{
alert("Link can't be empty");
b.focus();
return false;
}
else
{
alert('Review Succesfully Submitted');
window.open("reviewsubmit.html");
return true;
}
}
</script>
<title>Delicious Delights</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<header>
<div class="navbar">
<ul>
<li style="margin-left:-120px; opacity:500%; margin-top: 2px;"><a href="Home.html" class="Logo"><img src="LOGO.png" width="100px" height="65px"></a></li>
<li style="margin-left:-10px; font-size: 25px;"><a href="Home.html">Home</a></li>
<li style="margin-left:60px; font-size: 25px;"><a href="aboutusfood.html">About Us</a></li>
<li style="margin-left:60px; font-size: 25px;"><a href="recipes.html">Recipes</a></li>
<li style="margin-left:80px; font-size: 25px;"><a href="yourcart.html">Review</a></li>
<li style="margin-left:80px; font-size: 25px;"><a href="login.html">Login</a></li>
</ul>
</div>
</header>
<br>
<br>
<br>
<br><br><br>
<center>
<div class="reviewform">
<br>
<div class="reviewform">
<div class="glow">
<h3 style="font-size:65px; font-family:brush script mt ;margin-left:15px;">Review</h3>
</div>
<div class="reviewbox">
<div>
<form action="reviewsubmit.html" name="form1" >
<fieldset>
<label for="Name">Username: </label>
<input type="text" id="username" name="username" required><br><br>
<label for="Name">Recipe Link: </label>
<input type="text" id="Recipelink" name="Recipelink" required><br><br>
<label for="Name">Recipe Image: </label>
<input type="file" id="image-input" accept="image/jpeg, image/png, image/jpg">
<div id="display-image" style="
width: 400px;
height: 225px;
border: 1px solid black;
background-position: center;
background-size: cover"></div>
<script>
const image_input = document.querySelector("#image-input");
image_input.addEventListener("change", function() {
const reader = new FileReader();
reader.addEventListener("load", () => {
const uploaded_image = reader.result;
document.querySelector("#display-image").style.backgroundImage = `url(${uploaded_image})`;
});
reader.readAsDataURL(this.files[0]);
});
</script>
<label for="Name">Rating: </label>
<input type="number" id="Rating" name="Rating" required><br><br>
<label for="review"></label></p>
<textarea id="review" name="review" rows="5" cols="50" required>Write your review here!</textarea><br><br>
<input type="submit" id="submitbtn" value="Submit" onclick="validateform()"><br>
</fieldset>
</form>
</div>
</div>
</center>
</body>
</html>