Hacker News new | ask | show | jobs
by water42 2309 days ago
Don't filter input. Instead, prevent certain characters from being input in text elements. This is a user experience problem, not a software problem. The software can validate that a "name" is rejected if it does not follow the front end validations, but it doesn't need to do any more than that.

Of course, this argument does not extend beyond a "name" field to more complex fields. But more complex fields are less susceptible to introducing UX problems if certain characters are sanitized.