Real-time monitoring of words

Source: Internet
Author: User


Textarenum (' #FashionStatement ', Wsw_comment_num, ' #statementRowChk ', ' #my-comment ');

Real-time monitoring of Word function textarenum (name, num, prompt, obj) {
$ (name). Val (");
var limitnum = num;
var pattern = ' can also input ' + limitnum + ' word ';
$ (prompt). html (pattern);
$ (name). KeyUp (
function () {
var remain = $ (this). Val (). length;
if (remain > num) {
pattern = Wsw.msg.textareExceedNum;
$ (prompt). CSS ("Color", "red");
_COMMENT_STU2 = false;
if (obj) {
$ (obj). Children (). Find (". Rw3"). attr ("Class", "Rw3 am-form-group wsw_text_xs wsw_border_red");
}
} else if (remain! = 0) {
var result = Limitnum-remain;
Pattern = ' can also input ' + result + ' word ';
$ (prompt). CSS ("Color", "#999999");
_COMMENT_STU2 = true;
if (obj) {
$ (obj). Children (). Find (". Rw3"). attr ("Class", "Rw3 am-form-group wsw_text_xs wsw_border_green");
}
} else if (remain = = 0) {
if (obj) {
$ (obj). Children (). Find (". Rw3"). attr ("Class", "Rw3 am-form-group wsw_text_xs");
}
}
$ (prompt). html (pattern);
if (_comment_stu1 && _comment_stu2) {
if (obj) {
$ (obj). Children (). Find (". Btu_confirm"). attr ("Class", "am-modal-btn S2 btu_confirm wsw_text_greenblue");
$ (obj). Children (). Find (". Rw3"). AddClass ("Wsw_border_green");
}
} else {
if (obj) {
$ (obj). Children (). Find (". Btu_confirm"). attr ("Class", "am-modal-btn S2 btu_confirm wsw_text_red");
}
}
}
);


}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.