I have an HTML file which returns multiple GET values to my django view.py file.
If I submit only one value to view.py and read it with:
request.GET('variable')
then it works fine. But I am not sure how to GET multiple values.
I tried:
request.GET.getlist('variable1')
request.GET.getlist('variable2')
but it doesn't work.
My HTML file is:
<form action="/hello/" method="GET">
First_Name:<input type="text" name="arr[0]"><br>
Last_Name:<input type="text" name="arr[1]"><br>
<input type = "submit" value = "Submit">
</form>
My view.py file in the django app is:
def hello(request):
fn=request.GET['arr[0]']
ln=request.GET['arr[1]')
print fn
print ln
I have also tried:
fn=request.Get.getlist['arr[0]']
ln=request.Get.getlist['arr[1]']
What am I doing wrong?