Reputation: 211
in my django project I made a form using
message = forms.CharField(widget=forms.Textarea)
It works out ok and I get this. The text area is resizeable both horizontally and vertically:
I would like to make it un-resizeable horizontally, what should I do? I tried adding "attrs=" to the textarea but can't figure out what to call... Please help... Thanks.
Upvotes: 0
Views: 730
Reputation: 6096
I believe you can achieve this with a css rule:
resize: vertical;
So, one way is to give it a class
message = forms.CharField(widget=forms.TextArea(attrs={"class": "message"}))
Then define a css rule
.message{
resize: vertical;
}
Upvotes: 2