Development

#4151 (Missing HTML code for the Select form helper)

You must first sign up to be able to contribute.

Ticket #4151 (closed documentation: fixed)

Opened 4 months ago

Last modified 3 months ago

Missing HTML code for the Select form helper

Reported by: pierre.hurtevent Assigned to: fabien
Priority: minor Milestone:
Component: helpers Version:
Keywords: Cc:
Qualification: Unreviewed

Description

In the Definitive Guide to symfony Chapter 10 - Forms :

// Drop-down list with multiple selection (selected values can be an array)
In The Definitive Guide to symfony - Chapter 10 - Forms

<?php echo select_tag('payment', options_for_select(
  array('Visa' => 'Visa', 'Eurocard' => 'Eurocard', 'Mastercard' => 'Mastercard'),
  array('Visa', 'Mastercard')
), 'multiple=multiple') ?>

 => <select name="payment" id="payment" multiple="multiple">
      <option value="Visa" selected="selected"> 
      <option value="Eurocard">Eurocard</option>
      <option value="Mastercard" selected="selected">Mastercard</option>
    </select>

The end of the Visa option is missing, it must be replaced by

<option value="Visa" selected="selected">Visa</option>

And the name of the widget is an array (name="payment[]")

<select name="payment[]" id="payment" multiple="multiple">

Change History

08/26/08 23:10:53 changed by FabianLange

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

(In [11180]) doc: fixed typo in config path. Fixes #4151