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

CF8 for cftextarea maxlentgth is not working

Explorer ,
Aug 15, 2013 Aug 15, 2013

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

1.2K
Translate
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.

Translate
Engaged ,
Aug 15, 2013 Aug 15, 2013

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

Translate
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

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
Translate
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

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?

Translate
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
Translate
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

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.

Translate
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
Translate
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

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

Translate
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
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.

Translate
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