I am trying to create multi-line textarea on a php page and I want to check if the user cannot insert more than 50 characters per line or more than 50 lines. The idea is that the user can insert something from the spreadsheet, but if one row contains more than 50 characters, the rest will be discarded and will not be inserted into the next row. Therefore, I want to avoid the idea of having 50 separate text fields.
It would be ideal if this could be done in javascript (or php itself, but I have not seen anything like it in php).
Thanks!
UPDATE: Thanks for all the answers, but this will only work after the user submits the form, right? For example, if the maximum lines are 3 instead of 50, and the user inserts 100 consecutive characters and then breaks the line, he will leave only 50 characters, limiting the input to 2 instead of 3. I hope I understand ...
source
share