I failed to get the values of textarea in django, i pasted html code below.
<textarea id='msg' name='message' class='form-control' rows=10 cols=30/>
<textarea id='msg' name='message' class='form-control' rows=10 cols=30/>
I failed to get the values of textarea in django, i pasted html code below.
<textarea id='msg' name='message' class='form-control' rows=10 cols=30/>
<textarea id='msg' name='message' class='form-control' rows=10 cols=30/>
You should get your variable as follows if it is POST request:
request.POST.getlist('message[]')
Read documenation here.
Try to use:
request.POST.get('message', None)
You also can find here reference here: django MultiValueDictKeyError error, how do I deal with it
Please use this
request.POST.getlist('message')
where message is the name of your html attribute.