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 a (…)
Articles
editer_contenu_objet
Modifies the HTML content of forms
Calculating 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 (…)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 function (…)
Field separation using fieldset
When a form contains a large number of fields, they are generally broken up into various blocks, each known as a fieldset in HTML.
Such blocks (…)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 (…)
Passing arguments to the CVT functions
The charger(), verifier() and traiter() functions do not receive any parameters by default. php function formulaires_x_charger_dist()… function (…)
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. To (…)
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 HTML (…)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 (…)