character counter

8 posts by 4 authors in: Forums > CMS Builder
Last Post: June 20, 2011   (RSS)

By Maurice - July 14, 2010

when setting the max en min characters lenght

is there an easy way to ad a counter how many characters i have left.

would also be great with the twitter plugin or for a sms system that we have.

some one a great idea???

thnx m
-------------------------------------------

Dropmonkey.nl

Re: [Maurice] character counter

By Jason - July 14, 2010

Hi Maurice,

If want a counter that is being updated while a person is typing, you'll need to use Javascript because this has to take place on the client's side.

I think this article has what's you're looking for:
http://www.astral-consultancy.co.uk/cgi-bin/hunbug/doco.cgi?11290


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Maurice] character counter

By Jason - July 15, 2010

Hi Maurice,

Yes, if you wanted to have a real-time character counter for CMSB, you would have to work in some javascript. Since this would have to alter the way that CMSB displays fields, it would take quite a bit of customization.

The are a couple of work arounds we can try. First, you could set up an external form using a javascript counter that submits to CMS Builder. Another solution would be to use the minimum/maximum length settings for a text box field. This won't supply you with a counter, but it will enforce the max/min limits you're looking for.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] character counter

By flamerz - July 15, 2010

it would be nice to allow some custom "code inyection" inside the textareas, input fields, and so. [:)]

that would allow to insert some javascript and to create counters, field validation, ...

Re: [flamerz] character counter

By Maurice - July 16, 2010

Jason thnx fot the great reply's

Hi Flamerz,

I agree with you example of e annoying problem customers come up with is the twitter add on you can see how many characters you have left.

greetz
-------------------------------------------

Dropmonkey.nl

Re: [Jason] character counter

By gkornbluth - June 19, 2011

Hi All,

I'm trying to eliminate some of a client's frustration with a max character limit in a text box. (They can't tell they're over the limit until they try to save the page.)

Has anyone come up with a way of showing a visible character count while someone is typing in the text box, or even limiting the amount of characters that can be typed in to the box (without using forms or external javascript) that they'd be willing to share?

The idea of real time feedback as you typed might be really cool for other disallowed input situations as well, kind of like how spell check works.

Thanks,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] character counter

By Jason - June 20, 2011

Hi Jerry,

Since the HTML element <textarea> doesn't have a maxlength attribute and we can't run any PHP code until after the form is submitted, we would be forced to use a client side script like javascript to accomplish this.

The script could be used to disallow input after a certain number of characters, display a count of the characters entered so far, or both. It would be possible to create a plugin that would attach the necessary javascript function as well as attaching the function call to the appropriate fields.

If you're interested in this, pleas send an email to consulting@interactivetools.com and we can go over some options.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/