Answer the question
In order to leave comments, you need to log in
How can I prevent the input field from being changed in a Django form?
Good afternoon, please tell me who knows. I have a form, how do I prevent the user from changing some fields. What would these fields be, but what manipulations with them could not be carried out?
Answer the question
In order to leave comments, you need to log in
somefield = forms.CharField(
widget=forms.TextInput(attrs={'readonly':'readonly'})
)
100% nothing.
There is a magic button in browsers - F12
You can change values in DOM objects. Some people like to block the page until you register - change the properties of the object and continue reading))).
I can even change POST requests.
Do a validation when the form is submitted.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question