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

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

Author Mark Baber Published : Updated : 12/03/23

Translations : English, Español, français