Added character count to commenting

This commit is contained in:
GDColon 2019-11-17 17:13:42 -05:00
parent 469ffaf4b7
commit d57d7c7eea

View file

@ -15,6 +15,7 @@
<div class="popup" id="postComment"> <div class="popup" id="postComment">
<div class="brownbox bounce center supercenter" style="height: 80%; width: 110vh"> <div class="brownbox bounce center supercenter" style="height: 80%; width: 110vh">
<p style="position:absolute; right: 1vh; margin-top: 0; text-align: left" id="charcount">150</p>
<h1 class="smaller center" style="font-size: 5.5vh">Add Comment (Beta)</h1> <h1 class="smaller center" style="font-size: 5.5vh">Add Comment (Beta)</h1>
<textarea placeholder="Insert comment" id="content" maxlength="150" style="margin: 2% 0%"></textarea><br> <textarea placeholder="Insert comment" id="content" maxlength="150" style="margin: 2% 0%"></textarea><br>
<form id="form" action="nothing lol"> <form id="form" action="nothing lol">
@ -278,6 +279,10 @@ $('#refresh').click(function() {
appendComments() appendComments()
}) })
$('#content').on('input', function() {
$('#charcount').text(150-$('#content').val().length)
})
$('#submitComment').click(function() { $('#submitComment').click(function() {
let comment = $('#content').val() let comment = $('#content').val()
let username = $('#username').val() let username = $('#username').val()