我希望能够显示当前用户正在写入文本时在asp标签中写入文本框中的当前字符数。 我已经阅读了网络上的部分文章,但没有一篇适用。Asp.net计数正在写入文本框中的字符数
我使用
<asp:TextBox ID="txtInput" runat="server" TextMode="MultiLine" onkeyup="Count(this.id)"></asp:TextBox>
和
<script type="text/javascript">
function Count(x) {
document.getElementById(lbNrChar).value = document.getElementById(x).value.length;
}
</script>
但没有任何成功..试图
你看了哪些文章?你用什么代码不起作用? – BigBlondeViking 2009-08-25 16:29:54
我正在使用上面的代码,但没有任何内容显示在我的标签文本中。标签ID是lbNrChar。 – Blerta 2009-08-25 16:43:15