Results 1 to 2 of 2

Thread: sms character counter problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Posts
    9

    sms character counter problem

    I have a script that counts the characters in a textarea field, and it works fine, but I need to change the number of characters that counts when user press "Enter - Reurn" from his keyboard.The following function each "Enter" counts it for 2 characters.I need to change that.Any suggestions?


    [code]
    function CountDown()
    {
    var inputStr;
    var strlength;
    var maxNumber;
    var form1Number;

    form1Number = 1;
    maxNumber = 3000;
    if (document.form1.list2.value != null)
    {
    inputStr = document.form1.list2.value;
    strlength= inputStr.length;
    if (strlength > maxNumber )
    {
    document.form1.list2.value=inputStr.substring(0,maxNumber);
    charleft = 0;
    }
    else
    {
    charleft = maxNumber - strlength;
    }

    document.form1.form1LEFT.value="'Left " +charleft + " Characters";
    }
    }
    [code]

  2. #2
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    Why would the number of characters change by pressing enter or return?

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width