• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF8 for cftextarea maxlentgth is not working

Explorer ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

Hi,

I'm using CF8 and this is my code

<cftextarea id="summary" name="summary" rows="5" cols="80" maxlength="300" required="yes" validate="noblanks" message="You must enter summary." />

It is not working. Am I doing anything wrong?

Thanks

Joe Green

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Aug 15, 2013 Aug 15, 2013

function limitText1(limitField,  limitNum) {     if (limitField.value.length > limitNum) {         limitField.value = limitField.value.substring(0, limitNum);         alert("Character limit exceeded - please reduce the length of description.");     } }  and   onKeyDown="limitText1(this.form.summary,300);  Works finally.

Votes

Translate

Translate
Engaged ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

What do you mean by 'not working'?  Does nothing appear?  Are you able to type in more than 300 characters?  Do you get a javascript error?  ... etc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

Hi Joe,

Can you be more specifc about this issue, what is it that not woking and is it not validating the maxlength.

Try and use validate="maxlength"

Thanks,

Priyank

Thanks,
Priyank Shrivastava

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

Yes now it is working with validate="maxlength".

Is there a way to stop user from typing more characters than say 300 or show char counter?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

maxlength="300" is not enough because user can keeping on typing over the 300 limit.  That's why I'm wondering if there is any way we can disable keys after 300 character limit has reached or display the number of charaters typed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

This script doesn't work with cftextarea. Got a love Coldfusion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2013 Aug 15, 2013

Copy link to clipboard

Copied

LATEST

function limitText1(limitField,  limitNum) {     if (limitField.value.length > limitNum) {         limitField.value = limitField.value.substring(0, limitNum);         alert("Character limit exceeded - please reduce the length of description.");     } }  and   onKeyDown="limitText1(this.form.summary,300);  Works finally.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation