Maximum length on a textarea in Ruby on Rails

前端 未结 4 1507
花落未央
花落未央 2020-12-20 12:23

I tried applying the :maxlenght => 40 on a textarea on my form. But it didn\'t work out. Can we have a length limit on a textarea?

The code for text are

4条回答
  •  生来不讨喜
    2020-12-20 13:17

    Could it be due to a typo?

    ":maxlenght => 40 " in your post is misspelt.

    EDIT:

    I didn't read your post carefully. I think there is no maxlength attribute for textarea in HTML. You will have to handle it in JavaScript. There is more information in "MaxLength on a Textarea".

提交回复
热议问题