If I have a form like the example:
<form action="/foo/bar/" method="post">
<input type="text" name="your_name" />
<select multiple="multiple" name="bands">
<option value="beatles">The Beatles</option>
<option value="who">The Who</option>
<option value="zombies">The Zombies</option>
</select>
<input type="submit" />
</form>
And I call request.POST.getlist('bands'), is the order of the bands
going to always be the same as provided in the select box?
Or another case, if I have the form:
<form action="/foo/bar/" method="post">
<p>Select bands in the order you want them to play:</p>
<select name="bands">
<option value="beatles">The Beatles</option>
<option value="who">The Who</option>
<option value="zombies">The Zombies</option>
</select>
<select name="bands">
<option value="beatles">The Beatles</option>
<option value="who">The Who</option>
<option value="zombies">The Zombies</option>
</select>
<select name="bands">
<option value="beatles">The Beatles</option>
<option value="who">The Who</option>
<option value="zombies">The Zombies</option>
</select>
<input type="submit" />
</form>
In this case, only 1 item can be selected per select box but they are
all named the same so I can get them as a list via getlist(). Will
the value of getlist() be in order as selected in the form?
I'm trying to determine if I can do something the easy way (depend on
the order as provided in the form) or do I have to name the fields in
such a way to remember the order on POST.
Thanks,
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---