Results 1 to 4 of 4

Thread: measurement of string length

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175

    measurement of string length

    i have the folowing code
    function CheckData(frm)
    {
    alert((frm.Text_ID.Text));
    }
    frm.Text_ID - is a textbox in a form - how can i measure its string input length
    i have tried frm.Text_ID.length - its not really working
    so how can i have the length of the text in the text box.
    thanks

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Code:
    alert(String(frm.Text_ID.value).length);

  3. #3
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    function CheckData(frm)
    {
    alert((frm.Text_ID.Text));
    }
    change it to this....
    Code:
    function CheckData(frm)
    {
    window.alert((frm.Text_ID.Text.length));
    }
    here's an example using a textbox that uses " value " rather than " text "...
    Code:
    <p><FONT face="verdana, arial, helvetica" 
                      size=2>
    <INPUT class=bginput tabIndex=1 maxLength=85 size=40 
                      name=title value="testing"></FONT></p>
    <p><FONT face="verdana, arial, helvetica" size=2> 
    
    
    </font> 
    
    <script language="javascript">
    window.alert(title.value.length);
    </script>
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175

    thanks thanks

    altough those solusions didnt help they gave me great direction - and i solved it thak to u!!!!!
    thanks

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