Here is the simple JavaScript code to do this task
<%@ Page Title=”” Language=”C#” MasterPageFile=”~/MasterPage.master” AutoEventWireup=”true” CodeFile=”JavaScriptTest.aspx.cs” Inherits=”Default2″ %>
<asp:Content ID=”Content2″ ContentPlaceHolderID=”ContentPlaceHolder1″ Runat=”Server”>
<p>
Comment
<asp:TextBox ID=”txt_HeadLine” onkeyup=”chkmsg1(‘txt_HeadLine’)” runat=”server” Height=”97px” TextMode=”MultiLine”
Width=”586px”></asp:TextBox>
<asp:Label ID=”lbl_HeadlineCount” runat=”server” Text=””></asp:Label>
</p><script language=”javascript”>
function chkmsg1(as) {
var a = document.getElementById(‘<%=txt_HeadLine.ClientID%>’).value.length;
var len = document.getElementById(‘<%=txt_HeadLine.ClientID%>’).value.length;
var str = document.getElementById(‘<%=txt_HeadLine.ClientID%>’).value;a = parseInt(a);
a = 75 – a;if (a >= 0) {
document.getElementById(‘<%=lbl_HeadlineCount.ClientID%>’).innerHTML = a + ‘ Remaining’;
}
else {
var x = str.substring(0, 75);
document.getElementById(‘<%=txt_HeadLine.ClientID%>’).value = x;
document.getElementById(‘<%=txt_HeadLine.ClientID%>’).blur();
}
return true;
}</script>
</asp:Content>
bookmarked!!, I like your site!
Thank you.
I am sure this post has touched all the internet viewers, its really really
nice paragraph on building up new webpage.
Spot on with this write-up, I actually think this amazing site needs a great deal more attention. I’ll
probably be back again to read through more, thanks for the
advice!
Interesting post )
http://wndbl0v3.com my blog