May
13th
Tue
13th
Count Bytes in JavaScript
Sometimes your form input might have limited storage on the server—such as when your database uses a varchar field in an older Oracle database. If you’re using UTF-8 on both your forms and in your database, you might want to validate if the user typed too many characters. Here’s some JavaScript that does this using a trick.