Opened 18 years ago

Closed 18 years ago

#1963 closed defect (invalid)

Multiple form variables of the same name get lost.

Reported by: anonymous Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Multiple form variable of the same name get lost.

<form action="./result" method="post">

<input name="moo" value="one" />
<input name="moo" value="two" />

<form>

request.POST[moo] is two

This would be fine if the other values were accessible at middleware level, unfortunately they are not, so it is impossible to prioritise them or process them into, for example, a list for the view to deal with.

Change History (1)

comment:1 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

This is how HTML forms work. If you have multiple <input name="moo"> elements, only the last one gets saved. The solution is to use different names for your <input> tags.

Note: See TracTickets for help on using tickets.
Back to Top