Development

#3399 ([PATCH] fixes bug in sfFillInForm with multiple checkboxes of the same name)

You must first sign up to be able to contribute.

Ticket #3399 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

[PATCH] fixes bug in sfFillInForm with multiple checkboxes of the same name

Reported by: dball Assigned to: FabianLange
Priority: minor Milestone: 1.0.14
Component: form Version: 1.0.13
Keywords: fillin form Cc:
Qualification: Unreviewed

Description

A common web design idiom is to use multiple checkboxes of the same name to ask the user to select more than one value for a field. Symfony, along with rails and friends, makes this easy by automatically looking for multiple values for request parameter names ending in [], and putting those values into an array:

<input type="checkbox" name="choice[]" value="Steak" />
<input type="checkbox" name="choice[]" value="Eggs" />

# This will be an array
$values = $this->getRequestParameter('choice');

Sadly, the fillin form feature does not work properly in this circumstance. The attached patch fixes it.

Attachments

patch.txt (0.9 kB) - added by dball on 04/23/08 21:10:27.

Change History

04/23/08 21:10:27 changed by dball

  • attachment patch.txt added.

04/30/08 17:52:35 changed by FabianLange

  • owner changed from fabien to FabianLange.
  • status changed from new to assigned.

04/30/08 18:16:10 changed by FabianLange

its a duplicate of #1776

04/30/08 18:23:38 changed by FabianLange

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed: (In [8695]) sf1.0: made sfFillInForm work with checkbox arrays as well like checkbox_many[]. including unit tests. fixes #1776, #3399