SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Textarea character/page counter

    There are lots of javascript textarea counters/limiters out there,
    but what I need is a counter that counts and displays the number
    of characters being typed, the current page number(i.e say 160
    characters make a page), and probably the number of characters
    left per page. No limit to number of characters typed, just count
    characters and pages and displays them....any help?

    Thanks.

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,196
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    If im reading your post right you want a counter to which checks for 160 characters then creates a new page or am i not understanding correctly?

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    One way to get those value is:

    Code javascript:
    characters = Number(totalCharacters % 160);
    page = Number(totalCharacters / 160 + 1);
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SgtLegend View Post
    If im reading your post right you want a counter to which checks for 160 characters then creates a new page or am i not understanding correctly?
    Yes

  5. #5
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any link to an available one online?


Bookmarks

Posting Permissions

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