文本框上的JQUERY char计数器? [英] JQUERY char counter on textbox ?

查看:71
本文介绍了文本框上的JQUERY char计数器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在具有runat = server属性的asp.net文本框上使用jquery char计数器.

这是我的代码:

Hi all ,

I am using a jquery char counter on asp.net textbox that has the runat=server attribute.

Here is my code :

<script type="text/javascript">
      var brief = document.getElementById('<%=TextBoxBriefDescription.ClientID %>');
      $(document).ready(function() {


          $(brief).jqEasyCounter({
              'maxChars': 65,
              'maxCharsWarning': 60,
              'msgFontSize': '12px',
              'msgFontColor': '#000',
              'msgFontFamily': 'Verdana',
              'msgTextAlign': 'left',
              'msgWarningColor': '#F00',
              'msgAppendMethod': 'insertBefore'
          });


      });
  </script>



但是我遇到了这个错误:对象不支持此属性或方法,该属性或方法显示在javascript调试器中的简短变量上.那么如何访问此jquery插件中的文本框?

预先感谢.



but i am getting this error : Object doesn''t support this property or method,which is shown on the brief variable in the javascript debugger.So how can i access the textbox in this jquery plugin ?

Thanks in advance.

推荐答案

(document).ready(function(){
(document).ready(function() {


(简短).jqEasyCounter({ 'maxChars':65, 'maxCharsWarning':60, 'msgFontSize':'12px', 'msgFontColor':'#000', 'msgFontFamily':'Verdana', 'msgTextAlign':'左', 'msgWarningColor':'#F00', 'msgAppendMethod':'insertBefore' }); }); < /script >
(brief).jqEasyCounter({ 'maxChars': 65, 'maxCharsWarning': 60, 'msgFontSize': '12px', 'msgFontColor': '#000', 'msgFontFamily': 'Verdana', 'msgTextAlign': 'left', 'msgWarningColor': '#F00', 'msgAppendMethod': 'insertBefore' }); }); </script>



但是我遇到了这个错误:对象不支持此属性或方法,该属性或方法显示在javascript调试器中的简短变量上.那么如何访问此jquery插件中的文本框?

预先感谢.



but i am getting this error : Object doesn''t support this property or method,which is shown on the brief variable in the javascript debugger.So how can i access the textbox in this jquery plugin ?

Thanks in advance.


尝试下面的代码


Try the code below


<script src="jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="jquery.jqEasyCharCounter.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        
        var brief = document.getElementById('<%=text1.ClientID %>');


这篇关于文本框上的JQUERY char计数器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆