» Công Nghệ Thông Tin » Chinh Phục Forumtion » Các Code Hay » Share code bắt buộc 10 kt trở lên khi comment


You are not connected. Please login or register

Share code bắt buộc 10 kt trở lên khi comment

Go down  Message [Page 1 of 1]

An Hùng BMT

An Hùng BMT
Admin
Admin

tạo 1 trang js. inthetopic
Code:
$(document).ready(function (g) {
var comment = $('textarea#text_editor_textarea'),
    minCommentgLength = 10, //Num. de caracteres mínimos para enviar
    $commentgValue = comment.val(),
    $commentgLength = $commentgValue.length,
    submitgButton = $('form input[type=submit]').hide();
    Copyrights = '©Copyright by giObanii. ©toxigeek.com. All Rights Reserved',
$('textarea#text_editor_textarea').after('<span class="tgcounter"></span>').after('<p class="tgcounter">Ghi 10 ký tự đi Ku: <span></span></p>');
counter = $('span.tgcounter');
$('form').find('p.tgcounter > span').html(minCommentgLength);
comment.keyup(function () {
var $this = $(this);
$commentgLength = $this.val().length;
counter.html($commentgLength);
if ($commentgLength > minCommentgLength - 1) {
submitgButton.fadeIn(200);
} else {
submitgButton.fadeOut(200);
}
});
});
CSS
Code:
/*Gioi han ky tu VNA-Giobanni*/
form span.tgcounter {float: right;color: #000;}
form p.tgcounter {font-size: 11px;float: left;color: #000;}
form p.tgcounter> span {color: #000;}
http://vnateam.123.st

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum