Reputation:
I'm wondering how the heck you make it impossible for others to change the values and the maxlength by using the source viewer. It causes a lot of trouble for me due to the fact that there is people changing these fields, typing a whole book into these fields. That screws up my database, how to prevent that? Heard something about HTML5, and it should be server sided. But I don't really get it, nor did I find anything about maxlength.
The text is being inserted into a database, and when it is retrieved it gets fucked up because of the lenghts.
Upvotes: 0
Views: 155
Reputation: 5516
You really can't prevent users from messing with the HTML through the browser dev tools.
Which is why you should also validate on the server side as well as the client side. On your code that processes the form post, do validation/sanity checks for all the data, including string length, min/max values etc. Only when the data passes your checks do you allow it into the database.
Depending on your framework/platform, there may be validation libraries that can assist with this.
Upvotes: 1