I saw this here:
How can I build multiple submit buttons django form?
Which I tried to mimic in my own code (I think I am not understanding the request.POST object very well)
Snippet from views.py:
def globe(request):
if request.method == 'POST':
#for key, value in request.POST:
# print (key,value)
if 'LoadLayer' in request.POST:
print 'LOADED LAYER'
elif 'notloadlayer' in request.POST:
print 'not loaded layer'
else:
print 'BLARG' #hits this all the time...
Then the html:
<form action="/" method="post" id="form">{% csrf_token %}
<!-- {{ form.as_table }} -->
<table>
{% for field in form %}
<tr><td><font color="white">{{field}}</font></td></tr>
{% endfor %}
</table>
<input type="submit" name="LoadLayer" value="Load Entities" />
<input type="submit" name="notloadlayer" value="Export KML" />
</form>
So yah none of that stuff is ever in the request.POST object (I have in comments where I tried to print out the items in the dictionary and it never printed too many things it said or some such error).
Not sure what part i'm missing or doing wrong?