Radio and checkbox fields

To display element lists of radio or checkbox controls, the syntax provided for wrapping the elements uses a <div class="choix"></div>. This formatting makes it possible to have buttons display before the labels, or to provide a horizontal radio list (using CSS statements).

  1. <li class="editer_syndication">
  2. <div class="choix">
  3. <input type='radio' class="radio" name='syndication' value='non' id='syndication_non'[ (#ENV{syndication}|=={non}|oui)checked="checked"] />
  4. <label for='syndication_non'><:bouton_radio_non_syndication:></label>
  5. </div>
  6. <div class="choix">
  7. <input type='radio' class="radio" name='syndication' value='oui' id='syndication_oui'[ (#ENV{syndication}|=={oui}|oui)checked="checked"] />
  8. <label for='syndication_oui'><:bouton_radio_syndication:></label>
  9. </div>
  10. </li>


To make the list display in horizontal mode using CSS, just make the "choix" divs display as inline:

  1. .formulaire_spip .editer_syndication .choix {display:inline;}

Author Mark Baber Published : Updated : 22/02/10

Translations : English, Español, français