How to prevent user from entering data into a form without changing the code?
I would like to know how to prevent the user from entering data into a f开发者_如何学运维orm without changing the code or adding Disabled
attribute.
For example, blocking the field to clear a given picture.
I can't apply such a scheme because the data did not persist.
$('.marker input').attr({
disabled: 'disabled'
});
Based on your comment (different roles) I would strongly recommend a server-side solution. Any javascript solution can easily be circumvented by simply disabling javascript.
Use the readonly
attribute:
$('.marker input').attr({
readonly: 'readonly'
});
精彩评论