Hi, i am trying to find a good JS character countdown script that i can use to count down the characters remaining in a text area field that i am using on my site.

I have done a lot of searching on google but a lot of them seem to have very long scripts and others scripts are over 6 years ago.

Can someone recommend a good, robust character countdown timer that works very well and does not require a lot of resources when it is running. I was hoping to find something similar to the twitter script (please see below)

Wow, cool, thanks... that is a nice small script... is it possible to change it so that it counts down from 110 characters... i can pay you something small via paypal if it is required, thanks for your help so far...

Paul_Wilkins
—
2012-03-11T23:29:49Z —
#4

oo7ml said:

Wow, cool, thanks... that is a nice small script... is it possible to change it so that it counts down from 110 characters

Yes indeed. This is where a config to allow for different uses can occur, for example:

Now i am confused with which script to use... which one would you recommend

Paul_Wilkins
—
2012-03-12T11:31:44Z —
#7

oo7ml said:

Also i am confused with which script to use... which one would you recommend

My code is useful if you want it to be capable of being able to fit many different needs.Your friends code is smaller because it does ply want you require, and nothing else.

I'd recommend that you go with the code from your friend, if you think that you won't ever need to change how the counter behaves.

oo7ml
—
2012-03-12T11:40:33Z —
#8

Ok, thanks Paul. Can i ask one final question, what other ways does your code handle the counter, as in controlling "how the counter behaves", thanks again for all your help, much appreciated

Paul_Wilkins
—
2012-03-12T12:00:03Z —
#9

oo7ml said:

Ok, thanks Paul. Can i ask one final question, what other ways does your code handle the counter, as in controlling "how the counter behaves", thanks again for all your help, much appreciated

It can count up, or count down. You can set a max value so that when counting down it will countdown from a certain number. You can tell it whether you want the counter to be displayed at first, or only after some text has been entered. It can be told to prevent an overrun, so that it's not possible to enter in more than the set max number of characters. You can disable the overrun so that counting down results in going to negative numbers, or counting up results in exceeding the max. It also sets the class to 'error' so that you can provide visual feedback about such overruns too.

It can do quite a bit.

oo7ml
—
2012-03-12T12:55:23Z —
#10

Wow cool, i will definitely use this for some other project but i think your first script will be fine for now, thanks again for your help Paul...

Paul_Wilkins
—
2012-03-13T00:19:33Z —
#11

oo7ml said:

Wow cool, i will definitely use this for some other project but i think your first script will be fine for now, thanks again for your help Paul...

Here's some additional info that will help.

The target property is required, and that's as minimal as it might be.