Commit b70fe0c3 authored by Erma Safira Nurmasyita's avatar Erma Safira Nurmasyita
Browse files

[FIX] Some interfaces, add review validation

parent 89bd9fb8
......@@ -79,8 +79,13 @@ h1 {
}
.right_button{
flex-basis: 350px;
margin-right: 120px;
margin-right: 20px;
}
#address {
font-family: 'Arial';
}
.upload-btn-wrapper {
position: relative;
margin-left: 10px;
......
......@@ -15,6 +15,7 @@
.history-image-item {
height: 200px;
width: 200px;
border: 2px solid black;
}
#label-history {
......
......@@ -70,4 +70,5 @@ input, textarea {
color: orange;
font-weight: bold;
letter-spacing: 2px;
cursor: pointer;
}
\ No newline at end of file
.book-detail {
margin-block-end: 50px;
}
.textarea-comment {
width: 100%;
font-size: 28px;
......@@ -6,12 +10,18 @@
resize: none;
}
.warning-empty-inputs {
position: relative;
.warning-empty-input {
display: none;
position: absolute;
}
#rating-area {
text-align: center;
}
.comment-bar {
margin-block-end: 50px;
width: 100%;
}
.fivestar-rating {
......
......@@ -54,6 +54,19 @@ img{
height: 150px;
width: 150px;
}
.pp {
border: 2px solid black;
}
button {
cursor: pointer;
}
.button_row {
font-size: 25px;
}
h3{
color: #F16303;
word-wrap: normal;
......
......@@ -12,6 +12,7 @@ function ratingClick(starValue) {
}
}
document.getElementById("rating-given").value = starValue;
document.getElementById("rating-area").style.display = 'none';
}
function hoverStar(starValue) {
......@@ -31,16 +32,20 @@ function noHoverStar(starValue) {
}
}
function IsEmptyCommentBar() {
function isEmptyCommentBar() {
return document.getElementById('comment').value === "";
}
function isEmptyRating() {
return document.getElementById("rating-given").value == 0;
}
function trySubmitSearch() {
if (IsEmptyCommentBar()) {
document.getElementById("warning-empty-input").style.display = 'table';
} else {
document.getElementById('book-review').submit();
if (isEmptyCommentBar()) {
document.getElementById("comment-area").style.display = 'table';
}
if (isEmptyRating()) {
document.getElementById("rating-area").style.display = 'table';
}
}
......
......@@ -65,8 +65,8 @@
<div class="flex-review-tab">
<div class="comment-bar">
<textarea id="comment" class="textarea-comment" name="comment" cols="180" rows="5"></textarea>
<span id="warning-empty-input" class="red-theme alert-box text-size-20 add-nunito-font c-round">
Input can\'t be empty</span>
<p id="comment-area" class="warning-empty-input red-theme alert-box text-size-20 add-nunito-font c-round">
Input can\'t be empty</p>
</div>
</div>
</div>
......@@ -84,7 +84,9 @@
$str = '
<div class="rating-pict">'.
self::show5Stars().
'</div>';
'<p id="rating-area" class="warning-empty-input red-theme alert-box text-size-20 add-nunito-font c-round">
Rating can\'t be empty</p>
</div>';
return $str;
}
......
......@@ -64,7 +64,7 @@
</div>
</div>
<div class="button_row">
<button type="button" class="text-size-30 add-nunito-font light-blue c-round" onclick="location.href=\'../book_detail?id='.$id.'\';">Detail</button>
<button type="button" class="add-nunito-font light-blue c-round" onclick="location.href=\'../book_detail?id='.$id.'\';">Detail</button>
</div>
';
$i += 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment