Forms
Sections
HTML structure
Forms are stored in the formulaires/ directory. A special HTML syntax allows easy customisation and reuse of forms.
Forms
SPIP provides a simple and powerful process to manage forms, called CVT (Charger, Vérifier, Traiter i.e. Load, Verify, Process). It breaks down (...)
Articles
Displaying the form
A file formulaires/joli.html is called from a template file using the syntax #FORMULAIRE_JOLI, which then calls and displays the form.
The (...)Radio and checkbox fields
To display element lists of radio or checkbox controls, the syntax provided for wrapping the elements uses a . This formatting makes it possible (...)
Handling errors returned
The verifier() function of the form can return errors if the submitted field contents are not correct; which we will see in more detail later. (...)
Executing the processes
Whenever the verification function doesn’t return an error, the form then moves on to the traiter() (processing) function. It is in this (...)
formulaire_charger
Modifies the table of values returned by the
charger
function for a CVT formCalculating the day-of-the-year
This short example makes it possible to calculate and display the day of the year for a date entered on a form.
This form will be named (...)editer_contenu_objet
Modifies the HTML content of forms
formulaire_verifier
Modifies the array returned by the
verifier
function for a CVT formExplaining 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 (...)
Translate anything
This simple example will create a small form that calls an external translation service to translate the content entered on that form. The (...)