Results 1 to 5 of 5

Thread: Minimum description with counter (javascript)

  1. #1
    linksor.com is offline Active Member
    Join Date
    Sep 2005
    Location
    Poland - Warsaw
    Posts
    341

    Default Minimum description with counter (javascript)

    I have implemented checking of the minimum length of the description.

    I'd like to inform submitter about the number of letters in the text box. I am not familiar with javascript but looking to add a counter near the word DESCRIPTION which shows how many letters where submitted in the text box area.

    Can you help me with that ?

  2. #2
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Google is your friend, found below as result #1

    http://www.smartwebby.com/DHTML/text...rs_counter.asp

  3. #3
    inspireme is offline Active Member
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    doesnt work in firefox...
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  4. #4
    linksor.com is offline Active Member
    Join Date
    Sep 2005
    Location
    Poland - Warsaw
    Posts
    341

  5. #5
    linksor.com is offline Active Member
    Join Date
    Sep 2005
    Location
    Poland - Warsaw
    Posts
    341

    Default

    sorry for bumping. it should be helpful:

    in add_form.html

    after last <script> .... </script> add

    Code:
    <script language="javascript" type="text/javascript">
    
    function validateIt(f)
    
    {
    
    	if (f.elements['description'].value.length<350)
    
    	{
    
    		alert('Description must be longer then 350 characters !!!');
    
    		return false;
    
    	}
    
    	return true;
    
    }
    
    </script>
    and a little below in <form .... > modify that line and add "onSubmit" funcion

    Code:
        <form action="add.php" method="post" enctype="multipart/form-data" name="add_frm" onSubmit="return validateIt(this);">

Similar Threads

  1. minimum amount of words in text boxs
    By echo@ in forum Blocks and Modification
    Replies: 4
    Last Post: 03-25-2008, 05:07 AM
  2. Replies: 2
    Last Post: 01-14-2008, 02:41 AM
  3. Minimum soze of the description
    By linksor.com in forum Blocks and Modification
    Replies: 5
    Last Post: 05-07-2007, 03:16 AM
  4. use sneaky redirects with javascript mouseovers
    By bugsdirectory in forum Website development, hosting and promotion
    Replies: 0
    Last Post: 02-13-2006, 04:54 PM

Posting Permissions

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