1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 18:30:53 +02:00

Character counting display added to meta description on admin News and Page inputs.

This commit is contained in:
Cameron
2021-08-12 11:51:55 -07:00
parent 64e705ced0
commit 32618817d1
5 changed files with 30 additions and 2 deletions

View File

@@ -183,6 +183,28 @@ $(document).ready(function()
$(this).html(orig + spin);
});
$('textarea').on("input", function(){
if($(this).attr("maxlength") === undefined)
{
return;
}
var maxlength = $(this).attr("maxlength");
var currentLength = $(this).val().length;
var countID = $(this).attr('id') + '-char-count';
if( currentLength >= maxlength )
{
$('#'+ countID + ' span').text('0');
}
else
{
$('#'+ countID).show();
$('#'+ countID + ' span').text(maxlength - currentLength);
}
});
$('#e-modal-submit').click(function () {