Text Box (Javascript to limit content)

Ask a Question related to Macromedia Dreamweaver, Design and Development.

  1. #1

    Default Re: Text Box (Javascript to limit content)

    Hi

    Thanks very much for replying to my problem. I don't know if I'm being a
    bit thick but I've copied the code and tried to test it but it doesn't work.
    I've copied the code used below. Am I missing something basic?

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    Function textCounter(field, countfield, maxlimit) {
    If (field.value.length > maxlimit) // If too long...trim it!
    field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    Else
    countfield.value = maxlimit - field.value.length;
    }
    // End -->
    </script>

    <!-- textCounter() parameters are: Text field, the count field, max
    length -->

    <center>
    <form name=myform action="http://www.netevolution.co.uk">
    <font size="1" face="arial, helvetica, sans-serif"> ( You may enter up To
    125 characters. )<br>
    <textarea name=message wrap=physical cols=28 rows=4
    onKeyDown="textCounter(this.form.message,this.form .remLen,125);"
    onKeyUp="textCounter(this.form.message,this.form.r emLen,125);"></textarea>
    <br>
    <Input readonly Type=Text name=remLen size=3 maxlength=3 value="125">
    characters Left</font>
    </form>
    </center>





    "Martha Graham" <martha@dmxzone.com> wrote in message
    news:bee2c2$n7k$1@forums.macromedia.com...
    > Hi Andi,
    >
    > I found this script:
    > [url]http://www.ex-designz.net/codemanager2/script_description.asp?ScriptID=340[/url]
    >
    > Hope it helps you.
    >
    > Martha Graham
    > [url]www.DMXzone.com[/url]
    > "Andi Fenner" <andi.fenner@domnickhunter.com> schreef in bericht
    > news:bee26l$mte$1@forums.macromedia.com...
    > > Does anyone know the Javascript to limit the amount of characters a user
    > can
    > > type into a text box.
    > >
    > > Any help would be appreciated.
    > >
    > > Ta, Andi
    > >
    > >
    >
    >

    Andi Fenner Guest

  2. Similar Questions and Discussions

    1. Error: content type of 'text/html; but expected 'text/xml'.
      Hi, I've created a webservice, which is working fine in development environment and UAT environment. but i received following error often in...
    2. Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
      Hi I'm trying to setup a webservice on a Windows 2003 server, however each time I call it I get the error: Client found response content type...
    3. found content type of 'text/html; but expected 'text/xml'
      Hi, i get the error "Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml' when i invoke a webservice...
    4. Content from a memo field: converting the rich text into plain text
      Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is...
    5. Javascript > resize layer to fit content
      Does anyone have a javascript which can, after clicking some button, rezise a layer to the content which is in it. Thank you, Robert Jansen
  3. #2

    Default Re: Text Box (Javascript to limit content)

    Andi

    Why don't you just set the max characters value in the properties of the
    textbox you wish to limit?

    Brendan


    "Andi Fenner" <andi.fenner@domnickhunter.com> wrote in message
    news:bee26l$mte$1@forums.macromedia.com...
    > Does anyone know the Javascript to limit the amount of characters a user
    can
    > type into a text box.
    >
    > Any help would be appreciated.
    >
    > Ta, Andi
    >
    >

    Singularity Guest

  4. #3

    Default Text Box (Javascript to limit content)

    I cant implement the code for the textcounter of a text area in asp.net which has a default text,that can be edited.
    Unregistered Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139