在页面输入框的边上显示可输入的剩余字符长度。

存在的问题:1、如果需要在校验长度的同时还需校验其他类型则会出现重复显示。2、动态提示框不能显示在下边,左边等边等,只能显示在右边。最好实现可以根据浏览器情况动态显示位置。

function fetchOffset(obj) {
    var left_offset = obj.offsetLeft;
    var top_offset = obj.offsetTop;
    var width_offset =obj.offsetWidth;
    var height_offset = obj.offsetHeight;
    while((obj = obj.offsetParent) != null) {
        left_offset += obj.offsetLeft;
        top_offset += obj.offsetTop;
    }
    return { 'left' : left_offset, 'top' : top_offset,'width' :width_offset,'height':height_offset  };
}

 

var  __msgTimer=null;
function CheckLength(src,min,max){
    src =$(src);
    if(src){
        var ___msgView;
    }
}

 

页面上调用方式:

<asp:TextBox ID="txt_Password" runat="server" onkeyup="CheckLength(this,6,20);" TextMode="Password"
               MaxLength="20"></asp:TextBox>

相关文章:

  • 2021-10-03
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-09-24
猜你喜欢
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-03-01
  • 2022-01-20
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案