Reputation: 91
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
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