I am facing a problem with saving large content in the backend. I want restrict the users with a mximum number of characters.
Before saving the record, I want to alert the user if the limit is exceeded.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The hard part is probably that it is richtext content that you are trying to save. So you can’t really tell the user to remove some characters if the content is too big, because formatting will also count as extra space in the text field.
The easiest solution is to alter the field
bodytextin thett_contenttable of your Typo3 website. Make it of the typeLONGTEXT, this can hold upto 4GB of content.Another solution would be to hookup the save button, or add a custom save button that validates the content. You can find an extension adding a custom save button here:
http://typo3.org/extensions/repository/view/marit_savedocemail/current/info/
See this file, that does the mailing (ie: would check the length):
http://typo3.org/extensions/repository/view/marit_savedocemail/current/info/class.user_hook_t3lib_tcemain.php/
And this file, that adds the button:
http://typo3.org/extensions/repository/view/marit_savedocemail/current/info/class.ux_alt_doc.php/
So what you could do is install this extension, see if it works, then alter it to your needs 🙂
Hope that helps 🙂