Try to fix textarea

This commit is contained in:
2024-05-17 13:54:09 +02:00
parent a8fc530308
commit fa372fdeb8
3 changed files with 89 additions and 9 deletions
+32 -2
View File
@@ -1,3 +1,30 @@
<style>
#comment {
resize: none;
overflow: hidden;
}
#comment-count {
right: 3px;
bottom: 0;
}
@supports selector(:has(html)) {
.was-validated .position-relative:has(:invalid)~.invalid-feedback {
display: block;
}
.was-validated :invalid~.invalid-feedback {
display: none !important;
}
}
@supports not selector(:has(html)) {
.was-validated :invalid~#comment-count {
display: none;
}
}
</style>
<form action="comment.php" method="post" class="needs-validation row m-0" novalidate>
<div class="col">
<h4 class="mb-3">Leave a Comment!</h4>
@@ -15,8 +42,11 @@
</div>
<div class="mb-3">
<div class="position-relative">
<textarea class="form-control" id="comment" name="comment" rows="3" maxlength="250" required placeholder="Comment here"></textarea>
<small class="text-muted position-absolute" id="comment-count" style="right: 20px; bottom: 0;">
<textarea class="form-control" id="comment" name="comment" maxlength="250" required placeholder="Comment here"></textarea>
<div class="invalid-feedback">
Please enter text.
</div>
<small class="text-muted position-absolute" id="comment-count">
0/250
</small>
</div>