[html-formfu] Grouped options in Select or Radiogroup

Carl Franks fireartist at gmail.com
Tue Sep 4 14:48:40 GMT 2007


On 03/09/07, bits <bits_formfu at itools.com> wrote:
> What's the YML syntax necessary to produce an option group in a Radiogroup
> or Select?
>
> For example, how would the following be written using a option groups
> instead of the 00-valued items:
>
> ---
>   elements:
>     - type: Select
>       name: month
>       options:
>       - [ 00, ----Q1---- ]
>       - [ 01, January ]
>       - [ 02, February ]
>       - [ 03, March ]
>       - [ 00, ----Q2---- ]
>       - [ 04, April ]
>       - [ 05, May ]
>       - [ 06, June ]
>       - [ 00, ----Q3---- ]
>       - [ 07, July ]
>       - [ 08, August ]
>       - [ 09, September ]
>       - [ 00, ----Q4---- ]
>       - [ 10, October ]
>       - [ 11, November ]
>       - [ 12, December ]

The YAML for that would be:

---
elements:
  - type: Select
    name: month
    options:
      - label: "----Q1----"
        group:
          - [01, January]
          - [02, February]
          - [03, March]
      - label: "----Q2----"
        group:
          - [04, April]
          - [05, May]
          - [06, June]
      - label: "----Q3----"
        group:
          - [07, July]
          - [08, August]
          - [09, September]
      - label: "----Q4----"
        group:
          - [10, October]
          - [11, November]
          - [12, December]

I'll update the docs with an example, too.

Carl



More information about the HTML-FormFu mailing list