September 02, 2010, 10:03:35 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Alternative FF download location here !
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Limit number of characters in textarea  (Read 696 times)
zANavAShi
Jr. Member
**
Offline Offline

Posts: 62


« on: October 05, 2006, 02:46:05 pm »

Hiya FFers,

I know I have seen this discussed somewhere, but you know how it is when the time comes that you need this knowledge and you can't find it anywhere?  Huh?

In one of my forms I need to limit the number of characters in a textarea to 1500, otherwise when that element is displayed in my preview on the last page the text spills over top of other fields below it on the page.

Can somebody please help me in my blonde moment and direct me to the correct page for a solution to this? I remember how to do this in HTML, but cannot figure out how to apply it in FacileForms.

Actually it would be really nice to have that as a new feature in upcoming release, where you can designate max characters in textarea like you you can in a text type field.

Thanks for reading and thanks in advance for your replies.

Cheers,
Zana
Logged
zANavAShi
Jr. Member
**
Offline Offline

Posts: 62


« Reply #1 on: October 05, 2006, 02:48:30 pm »

Oh drat, I am having a series of blonde moments tonight and posted in the wrong forum.

Admin, can you please move this over to Basic Form Topics where it should be.

Sorry about that  Undecided
Logged
fvds
Administrator
Living Legend
*****
Offline Offline

Posts: 2322



WWW
« Reply #2 on: October 05, 2006, 04:16:07 pm »

Zana,

I founbd this on the Forum:

Code:
function ff_submit_action(element, action)
{
    switch (action) {
        case 'click':
   // show the current length
   alert('Length is: '+ff_getElementByName('textarea').value.length);
   // check the length, trim
           if (ff_getElementByName('textarea').value.length > 10) {
ff_getElementByName('textarea').value = ff_getElementByName('textarea').value.substring(0, 10);
           };
            break;
        default:;
    } // switch
} // ff_submit_action
Logged

Fred

Please read the forum rules first!
Please do not use PM for generic questions!
Visit me at OverTheWeb
zANavAShi
Jr. Member
**
Offline Offline

Posts: 62


« Reply #3 on: October 06, 2006, 02:30:20 am »

Thanks for that Fred,

But I am wondering if it is possible to actually restrict the number of characters they type into the textarea as they are actually typing them, rather than for them to exceed the character limit and only find that out when they go to validate and then they get annoyed because they just wasted their time on too much typing.

You know... in the way it works when typing in a text field that has "Max.Length: 8 Columns" and when they go to type a 9th character the field will not accept that extra character entry?

Hope I am explaining myself properly here  Undecided

Cheers,
Zana
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF © 2001-2006 Lewis Media
| Terms of Use | Privacy | Sitemap |