Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

> > > > Explaining input fields

Explaining input fields

It is often necessary to provide an explanation so that the user knows how to correctly fill out particular fields in a form. SPIP offers 2 formats to do this, by inserting a <p> or <em> tag with a special CSS class:

  • explication (on a <p> element) is used to provide a more detailed explanation than the label of the field in question
  • attention (on an <em> element) highlights a description that has been provided. To be used with moderation!

These two descriptions are therefore additional to the other options already provided for an erreur (error) or an obligatoire (mandatory) field.

Example

  1. #SET{erreurs,#ENV**{erreurs}|table_valeur{nom}}
  2. <li class="editer_nom obligatoire[ (#GET{erreurs}|oui)erreur]">
  3. <label for="nom"><:titre_cadre_signature_obligatoire:></label>
  4. [<span class='erreur_message'>(#GET{erreurs})</span>]
  5. <p class='explication'><:entree_nom_pseudo:></p>
  6. <input type='text' class='text' name='nom' id='nom' value="[(#ENV**{nom})]" />
  7. </li>

Download