I am validating that a textarea’s value is not more than 255 characters.
I am validating front end and back end before updating the database.
If the textarea value is one long string without spaces or carriage returns jQuery trim and php trim return the same string length.
But if the textarea value has spaces and / or carriage returns throughout the string, jQuery and php ( after trim() ) return different string lengths. Could anyone tell me why? Or what I can do to get more accurate validation front end and back end.
Thanks in advance.