Wednesday, 2 May 2018

Count textarea character using jquery

//////////////HTML

<asp:TextBox runat="server" ID="txt_StrengthsPCI" CssClass="form-control" Rows="4"

                                        TextMode="MultiLine" Style="resize: none;" onkeypress="return TextArea_MaxCount(this.id,'StrengthsPCI',100);"></asp:TextBox>


/////////////Jquery


function TextArea_MaxCount(txtid, divcnt, maxLength) {
                        var length = $('[id$=' + txtid + ']').val().length;
                        var length = maxLength - length;
                        if (length > 0) {
                            $('#' + divcnt).text(length + ' Left');
                        }
                        else {
                            $('#' + divcnt).text(length + ' Left');
                            return false;
                        }
                    }

1 comment:

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...