001
001

Reputation: 65205

How do you stop people from editing a disabled inputbox?

When a input textbox is disabled, you can not enter any values into the Inputbox.

However if you use google chrome and right click on the inputbox then click on inspect, you can change the values.

How do you stop people from editing a disabled inputbox?

Upvotes: 0

Views: 208

Answers (3)

Starx
Starx

Reputation: 79031

There is no way you can stop people from changing its state and sending the data. There are two way you can do this

  1. Do not display the disabled input at all. Just like what Zend_Form does.
  2. Check the field when the form was submitted and remove it.

Upvotes: 1

Sheldon
Sheldon

Reputation: 39

As I known, the disabled input value won't be posted to server side. So if someone change the value using tools, the modified data will not be posted.

Upvotes: 0

Sergii Kudriavtsev
Sergii Kudriavtsev

Reputation: 10532

You can't. The only thing you can (and always should) do is validate user's input on server.

Upvotes: 6

Related Questions