zoukankan      html  css  js  c++  java
  • textCounter--之后要学习

    function textCounter(field, countfield, maxlimit){
      if (field.value.length > maxlimit){
      if( field.value.indexOf(" ") == maxlimit-1){
      field.value = field.value.substring(0, maxlimit-1);
      }else{
      field.value = field.value.substring(0, maxlimit);
      }
      }else{
      countfield.value = maxlimit - field.value.length;
      }
     }

    <tr>
    <td width="100" align="right" valign="top" class="row4">
    <bean:message key="reservation.ConfContents" />
    :
    </td>
    <td class="row2" align="center">
    <html:textarea property="conf_subject" cols="32" rows="5"
    styleClass="input2" style="100%"
    onkeydown="textCounter(conf_subject,remLen,255);"
    onkeyup="textCounter(conf_subject,remLen,255);"
    onmouseup="textCounter(conf_subject,remLen,255);"
    onmousedown="textCounter(conf_subject,remLen,255);"
    onmouseover="textCounter(conf_subject,remLen,255);"
    onmouseout="textCounter(conf_subject,remLen,255);">
    </html:textarea>
    <br>
    <bean:message key="reservation.InputLimit.prefix" />
    <html:text property="remLen" readonly="true" size="4" maxlength="3" />
    <bean:message key="reservation.InputLimit.suffix" />
    </td>
    </tr>

  • 相关阅读:
    BOM(JavaScript高程笔记)
    初识AJAX
    初识DOM
    《JavaScript DOM 编程艺术》读书笔记
    git/ TortoiseGit 在bitbucket.org 使用证书登陆
    原生JS的对象常用操作总结
    js 判断对象相等
    IE 坑爹的浏览器兼容模式
    Linux+mysql混杂
    前端-CS-04
  • 原文地址:https://www.cnblogs.com/hanyingme/p/3468672.html
Copyright © 2011-2022 走看看