Tibi Forms
Tibi uses Gravity Forms for editor-managed forms and custom React forms for service flows that submit to NLB APIs or a local WordPress REST endpoint.
Last modified: July 9, 2026
Decision Map
| Need | Implementation | Notes |
|---|---|---|
| General editor-managed form | Gravity Forms block | Flexible fields; entries are deleted by default after submission. |
| Borrower signup | Skjema: Meld deg inn (tibi/form-signup) |
Custom React app submitting to NLB enrollment endpoints. |
| Loan-right confirmation | Skjema: Bekreftelse på lånerett (tibi/form-confirm) |
Custom React app with file upload support. |
| Brochure ordering | Brochures with child Brochure blocks |
Custom WordPress REST order flow and email notifications. |
Gravity Forms
Core behavior is customized in packages/wordpress/plugins/tibi-core/inc/gravityforms.php.
Editor behavior:
- Add the Gravity Forms block where the form should appear.
- In form settings, use
Keep entries in databaseonly when there is an explicit retention need. - Allowed upload extensions include common music notation formats:
xml,musicxml,mxl,mus,sib, andmscz. - The validation summary is replaced with
Feil og mangler i skjemaet.
Developer behavior:
gform_entry_createdandgform_post_add_entryboth calldelete_gf_entry.- Entries are deleted unless the form setting
keep_entries_in_databaseis truthy. - The theme loads
gravityforms.tsxwhen a page contains agravityforms/formblock or when viewing the legacy FAQ archive.
Signup Form
Full block reference: Signup form block.
Editor block:
- Block name:
tibi/form-signup - Editor title:
Skjema: Meld deg inn - Editable fields: Bokmal and Nynorsk thank-you messages.
Frontend behavior:
- React entrypoint:
packages/wordpress/themes/tibi/src/signup.tsx - Mount point:
#signup-root - Browser draft storage:
sessionStoragekeytibi_signup_form - Categories:
adult,youth,student,institution - Steps: personal information, loan information, consent, confirmation.
API behavior:
| Category | Endpoint |
|---|---|
| Adult | /v1/enrollments/adult |
| Youth/child | /v1/enrollments/child |
| Student | /v1/enrollments/student |
| Institution | /v1/enrollments/institution |
The base URL is https://api.nlb.no in production and https://api.dev.nlb.no outside production. Empty values are removed before submit. The offline PDF fallback comes from ACF options pdf_schema_nb and pdf_schema_nn.
Loan-Right Confirmation
Full block reference: Loan-right confirmation block.
- Block name:
tibi/form-confirm - Editor title:
Skjema: Bekreftelse på lånerett - Editable fields: Bokmal and Nynorsk thank-you messages.
- Frontend entrypoint:
packages/wordpress/themes/tibi/src/confirm.tsx - Mount point:
#root - Endpoint:
POST {apiBaseUrl}/v1/enrollments/verify - Submitted as
FormDatawith fields for name, phone, email, national ID, and attachments.
Brochures
Full block reference: Brochures block.
Editor structure:
| Block | Purpose | Key fields |
|---|---|---|
tibi/brochures |
Parent order form | Title, description, thank-you message. |
tibi/brochure |
One orderable brochure/material item | Title, description, attachment, image, Bokmal/Nynorsk/English toggles. |
Frontend behavior:
- React entrypoint:
packages/wordpress/themes/tibi/src/brochures.tsx - Mount/data elements:
#brochures-container,#brochures-data,#brochures - Steps:
Velg materiell,Bestilling,Bekreftelse - Local endpoint:
POST /wp-json/tibi/v1/submit-order
Submission behavior:
- Required fields:
name,phone,email,address,town,zipCode. - Internal email:
nlb-utlaan@nb.no - Internal subject:
Brosjyreskjema - Sender:
Tibi <utlaan-tibi@nb.no> - User confirmation subject:
Takk for din bestilling! - Orders are sent by email; they are not stored as WordPress entries.
QA Checklist
- Test the form on stage:
https://beta.tibi.no. - Confirm the right script is loaded only when the matching block exists.
- Submit with missing required fields and verify the global error summary focuses the first error.
- Submit a successful request and verify the correct thank-you text.
- For API-backed forms, verify the base URL targets the expected environment.