Reenu
Reenu

Reputation: 91

How to make the readonly textfield noneditable by Firebug?

We have a textfield with the readonly attribute set, e.g.,

<s:textfield id="xyz" name="test" value="xyz" readonly="true" />

While inspecting through Firebug the value of the field can be edited and the edited value is submitted.

How do I prevent readonly fields from being edited through Firebug?

Upvotes: 0

Views: 152

Answers (1)

Dave Newton
Dave Newton

Reputation: 160251

You don't.

Validation needs to be handled on the back end, regardless of any client-side validation/properties you've set. Clients can always send requests you don't expect, whether through malice or simple twiddling. If something shouldn't be editable then the back end needs to ensure it isn't.

Upvotes: 1

Related Questions