Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to count number of lines in textarea

how to count number of lines in textarea

Scheduled Pinned Locked Moved ASP.NET
htmlhelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    unil Dhiman
    wrote on last edited by
    #1

    HI All i have a textarea. and i want to count number of lines in this textarea. actually i have created a HTML Editor using textarea. can anybody tell me how to solve this problem. thanks.

    L S 2 Replies Last reply
    0
    • U unil Dhiman

      HI All i have a textarea. and i want to count number of lines in this textarea. actually i have created a HTML Editor using textarea. can anybody tell me how to solve this problem. thanks.

      L Offline
      L Offline
      Laddie
      wrote on last edited by
      #2

      you can count for the number of occurances for \n function countRows() { var rows = document.getElementById("test").value.split('\n');; alert(rows.length); } this will give the number of lines

      Thanks Laddie Kindly rate if the answer was helpful

      U 1 Reply Last reply
      0
      • U unil Dhiman

        HI All i have a textarea. and i want to count number of lines in this textarea. actually i have created a HTML Editor using textarea. can anybody tell me how to solve this problem. thanks.

        S Offline
        S Offline
        sumit7034
        wrote on last edited by
        #3
        U 1 Reply Last reply
        0
        • S sumit7034
          U Offline
          U Offline
          unil Dhiman
          wrote on last edited by
          #4

          thanks sumit.

          1 Reply Last reply
          0
          • L Laddie

            you can count for the number of occurances for \n function countRows() { var rows = document.getElementById("test").value.split('\n');; alert(rows.length); } this will give the number of lines

            Thanks Laddie Kindly rate if the answer was helpful

            U Offline
            U Offline
            unil Dhiman
            wrote on last edited by
            #5

            thanks Laddie.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups