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>

  • 相关阅读:
    Bootstrap/Font-Awesome/sweetalert插件
    网络编程
    异常处理
    再看属性查找
    元类
    面向对象中的一些内置方法
    反射
    内置函数
    绑定方法与非绑定方法
    多态与鸭子类型
  • 原文地址:https://www.cnblogs.com/hanyingme/p/3468672.html
Copyright © 2011-2022 走看看