#1
  1. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    1
    Rep Power
    0

    getting # of chars from text box in javascript


    I am a newbie, trying to pull the number of characters typed in a text box to run formula i am working on, if someone could please show me in code form how to do this it would be greatly appreciated.
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    document.formname.inputname.value.length
    Code:
    <form name="myForm">
    <input type="text" name="myInput" /><br />
    <input type="button" value="Get Length" onclick="javascript:alert(document.myForm.myInput.value.length)" />
    </form>
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.

IMN logo majestic logo threadwatch logo seochat tools logo