Results 1 to 2 of 2

Thread: text area counter

  1. #1
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default text area counter

    first of all I followed this link but it did not work

    http://www.dynamicdrive.com/forums/s...ad.php?t=62400


    I now have my counter working in my form.
    This is what I have entered in the head.

    Code:
     <SCRIPT LANGUAGE="JavaScript">
    <!-- Limit the number of characters per textarea -->
    <!-- Begin
    function textCounter(field,cntfield,maxlimit) {
    if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else
    cntfield.value = maxlimit - field.value.length;
    }
    //  End -->
    </script>
    This is what I have entered in the form. Now my ValidateForm() doesn't work on any of the other text and drop down boxes. They were coming up with an error message if they were not entered and someone tried to enter data in a box past the top one that was mandatory.

    Code:
    <form name="myForm" action="/articles/articles/javascript/dynamictextareacounter.asp?ID=<%=siteID%>" method="post" onsumbit="return validateForm()" enctype="multipart/form-data" id="myForm" >
    Last edited by djr33; 05-16-2011 at 05:17 PM. Reason: formatting-- please check the formatting after you post and edit if there are any problems so we can read it

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    The forum where you posted this is for submitting a new script. I am now moving it to the area for help with existing scripts.
    Additionally, your link does not work-- it says the discussion does not exist.

    Please give us more information and we will try to help. Be aware that in posting it's better for you if you are clear, so that we can help. If not, we won't be able to help you. This includes the formatting of your post such as using [code]....[/code] tags. I've fixed your post above though.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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