I need to change specific textarea max-length (currently 100 letters).

Where is the default value stored or how it is possible to override this setting?


The teaxtarea form field doesn't have any property for the maximum length of the accepted text. The module showing the textarea can implement a form validation handler to limit the length of the entered value, and (generally speaking) that limit is not saved in a module settings; it is generally hard-coded.

In the case the value contained in the textarea field is saved in a database table created from the module showing the form, there is another issue: The value contained in the textarea field must be contained in the database field. If it is longer than what the database field can store, you would get SQL errors.

| improve this answer | |
  • I used drupal themer module and found out that for the textarea is responsible function theme_textarea() There is an array of 25 elements and one of them is #default_value (String, 100 characters ). This field is supposed to contain more characters for sure (it should store multiple generated codes). Do you think that i can change it in the database? – loparr Aug 6 '12 at 19:09
  • theme_textarea() doesn't have a default value for the textarea form field, and the maximum length of the textarea field is not saved in the database. – kiamlaluno Aug 6 '12 at 19:13
  • Ok so you said that this value was hardcoded by a module that created this textarea. Would it be possible to find it in the database and change it? – loparr Aug 6 '12 at 19:56
  • It is not said that value is saved in the database at all. Most of the times, the length of a string saved in a textarea form field is not something users can change, which means it is hardcoded in the module which doesn't save it in the database. – kiamlaluno Aug 6 '12 at 20:01
  • I scanned thru the module files and found no such setting inside module files. The database was good hint however, I found it there and successfully changed it. Hm, But it has to be hardcoded inside some of the module files, right? I found it inside tables created by this module. – loparr Aug 6 '12 at 20:11

Is this for editing content? If it is, edit the content type that you want to change, find the field with the text area you want to change, and update the number of rows you want displayed by default.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.