Current location: Hot Scripts Forums » General Community » Script Requests » Active character counter


Active character counter

Reply
  #1 (permalink)  
Old 06-28-06, 06:12 PM
Andy128 Andy128 is offline
Wannabe Coder
 
Join Date: Jun 2006
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Active character counter

I have a php script that collects info from a form and validates it and then sends the data to my e-mail. One of the fields is a "Comments" area. I have limited it to 500 characters. Is there a way to have some sort of counter that counts backwards from 500 to let the person know how many characters are left to type. I would assume that this is a java-script.
I am more familiar with php at this point than java so would like to retain the php form script but incoroprate the counter.

Any ideas?

Andy
Reply With Quote
  #2 (permalink)  
Old 06-28-06, 06:17 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Something like this?

Code:
<textarea name="comments" onkeyup="document.getElementById('charsleft').innerHTML=(500 - this.value.length);"></textarea>

Chars left: <span id="charsleft"></span>
Reply With Quote
  #3 (permalink)  
Old 06-28-06, 06:45 PM
Andy128 Andy128 is offline
Wannabe Coder
 
Join Date: Jun 2006
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Man are you guys quick!!

Where would I put the script in relation to the php script?

Andy
Reply With Quote
  #4 (permalink)  
Old 06-28-06, 07:22 PM
Andy128 Andy128 is offline
Wannabe Coder
 
Join Date: Jun 2006
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Never mind- Figured it out.

Andy

PS- Thanks a million
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
authenticate Active Directory Users wajeeh_r ASP 5 04-27-09 11:36 AM
Wanted to replace special characters in MS Access using VB, but more than 1 character cebuy Visual Basic 3 12-04-05 05:30 PM
How to replace extended Character with character luv_suresh Perl 1 06-22-05 12:16 AM
Counter script (to offer free counter service) basara55 Script Requests 0 06-29-04 08:48 PM
character counter tylerc JavaScript 1 05-23-04 11:25 AM


All times are GMT -5. The time now is 11:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.