I'm trying to create a multiline textarea in a php page, and I want to validate so that if the user can't insert more than 50 characters per line, or more than 50 lines. The idea is that the user can paste something from a spreadsheet, but if one line has more than 50 characters, the rest will be discarded, and not inserted in the next line. That's why I want to avoid the idea of having 50 individual textboxes.
It would be ideal if this could be done in javascript (or php itself, but I didn't saw anything like it in php).
Thanks!
UPDATE: Thanks for all that answers, but that would work only after the user submitted the form, right? For example, if the max lines is 3 instead of 50, and the user inserts 100 consecutive characters, and then a line break, it would only have 50 characters left, limiting the inputs to 2 instead of 3. Hope I was clear...