Opened 8 years ago

Closed 8 years ago

#1963 closed defect (invalid)

Multiple form variables of the same name get lost.

Reported by: anonymous Owned by: adrian
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: UI/UX:


Multiple form variable of the same name get lost.

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

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


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.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.