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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. character count

character count

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nettutorialquestion
2 Posts 2 Posters 1 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.
  • D Offline
    D Offline
    Deepak the Cool
    wrote on last edited by
    #1

    i want count the number of character in textbox in asp.net.i.e. user enter only 30 character in textbox. and when user enter Character in text box the number of character left in textbox shown in lable i.e. if he/she enter 20 character the lable show character left 10 in lable. so how can i do this. if you suggest javascript then plese provide complete code because i know very litter about javascript & how to implement in asp.net. anuj :-O

    dcjoshi2

    J 1 Reply Last reply
    0
    • D Deepak the Cool

      i want count the number of character in textbox in asp.net.i.e. user enter only 30 character in textbox. and when user enter Character in text box the number of character left in textbox shown in lable i.e. if he/she enter 20 character the lable show character left 10 in lable. so how can i do this. if you suggest javascript then plese provide complete code because i know very litter about javascript & how to implement in asp.net. anuj :-O

      dcjoshi2

      J Offline
      J Offline
      Jim Conigliaro
      wrote on last edited by
      #2

      Javascript is the way to go: Characters Remaining: 30 function countCharacters(source, outputId, maximum) { outputElement = document.getElementById(outputId); if(outputElement) { var length = source.value.length; outputElement.innerText= maximum - length; } }

      Jim Conigliaro jconigliaro@ieee.org
      http://www.jimconigliaro.com

      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