user2599052
user2599052

Reputation: 1126

How to disable input type=text in javascript so that it can't be changed even by inspection

It is possible to disable input element by adding disabled attribute. However this can be removed by devtools that come with browsers. Is there any other way to deal with this so that devtools can't be used to enable it?

Upvotes: 0

Views: 205

Answers (1)

Guillaume Brunerie
Guillaume Brunerie

Reputation: 5371

No there is not. You should validate on the server side everything that comes from the client, because you can't trust the client at all. It's always possible to mess with the HTML/Javascript on the client side.

Upvotes: 2

Related Questions