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>

  • 相关阅读:
    委托使用不当导致内存变大
    Reactive Extension
    WPF TextBox输入显示提示
    Reactive Extensions 初识
    WPF 验证
    SPOJ 1487. Query on a tree III
    HDU3966 Aragorn's Story
    SPOJ 2939. Query on a tree V
    SPOJ 913. Query on a tree II
    SPOJ2666. Query on a tree IV
  • 原文地址:https://www.cnblogs.com/hanyingme/p/3468672.html
Copyright © 2011-2022 走看看