JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 31st, 2012, 08:57 AM
VixenUK VixenUK is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 1 VixenUK User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 24 sec
Reputation Power: 0
Help with character counter

Hello everyone. I wonder if anyone can help?

I found a character counter on the web and it works if used as is:

<script language="JavaScript">
function countit(what){
formcontent=what.form.charcount.value
what.form.displaycount.value=formcontent.length
}
</script>



<input type="text" name="charcount" size="40" >
<input type="button" onClick="countit(this)" value="Count" style="font-weight:bold;">
<input type="text" name="displaycount" size="3" style="font-weight:bold; text-align:center;">

***DOES NOT ALLOW ME TO LINK AN IMAGE***

What I want to do is have the character counter on each of the 3 form input lines below instead of having it above the 3 lines (which at the moment means the customers would have to use the counter at the top and then either cut/paste or re-type the counted text into Line1, Line2 and Line 3).

I have tried doing this but (although the button does render at the side of each field) nothing works character counting wise.

To better understand, please add this (DOES NOT ALLOW ME TO LINK TO A PAGE....) test product to the cart and get to checkout page 2 to see what I mean.

I would really appreciate it if someone could get this to work. Thanks.

Reply With Quote
  #2  
Old October 31st, 2012, 07:20 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 605 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 15 h 45 m 23 sec
Reputation Power: 69
Are you talking about something like this?

Code:
<script type="text/javascript">
function countit(count,displayCount)
{
var formcontent = document.getElementsByName("charcount")[0].value.length;
document.getElementsByName(displayCount)[0].value = formcontent;
}
</script>


<input type="text" name="charcount" size="40" >
<input type="button" onClick="countit('charcount','displaycount')" value="Count" style="font-weight:bold;">
<input type="text" name="displaycount" size="3" style="font-weight:bold; text-align:center;">

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Help with character counter

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap