I have an HTML form, with more than 30 fields in it. When this form is submitted to the server, all of the values of the fields should be trimmed. In other words, no value should start/end with any kind of whitespace (
There are many options available for me:
- Manually trim each value
- Looping over values and trim each one
- Creating a framework (something like ASP.NET's HTTP Module) to sit at the way of any HTTP Post request, to trim the incoming value.
The third option seems the best one. However, I don't know if it is really the best one or not? And I also don't know how to do it. Is it possible at all? What are other solutions?