Form

Last updated on Sep 16, 2025

Form Block

The Form block displays a customizable form that allows visitors to submit information. Forms are created in the Tourismo admin platform and can include various field types like text, email, dates, file uploads, and more.

Overview

The Form block is used to collect information from website visitors. It supports multiple field types and can be configured with reCAPTCHA protection. Forms are managed in the Tourismo admin platform and then displayed on your WordPress site.

Common Use Cases:

  • Contact forms
  • Booking requests
  • Event registrations
  • Feedback collection
  • Information requests

Block Features & Options

Form Selection

  • Select Form: Choose which form to display from your Tourismo admin forms

Display Options

  • Show Name: Display the form's name as a heading
  • Show Description: Display the form's description text

Security Options

  • Enable reCAPTCHA: Add Google reCAPTCHA protection to prevent spam submissions
    • Requires reCAPTCHA configuration in plugin settings
    • Can be enabled/disabled per form block
    • Validates submissions server-side with Google

Layout Options

  • Alignment: Left, center, or right align the form
  • Custom CSS Class: Add custom CSS classes for styling

How it Works

The Form block connects to your Tourismo admin platform to retrieve form configurations. When a visitor submits the form, the data is sent back to the Tourismo platform for processing. The block supports various field types including text, email, dates, file uploads, checkboxes, and dropdown selections.

Form Data Preservation: If form submission fails (e.g., missing reCAPTCHA), all entered data is preserved so users don't lose their work. They only need to complete the missing requirements and resubmit.

reCAPTCHA Integration: When enabled, Google reCAPTCHA v2 (checkbox) is displayed above the submit button. The form validates the reCAPTCHA response server-side before processing the submission.

How to Add & Configure

  1. Add the Form Block to your page or post
  2. Select a Form from the dropdown in the block settings sidebar
  3. Configure Display Options:
    • Toggle "Show Name" to display the form title
    • Toggle "Show Description" to display form description
    • Enable "reCAPTCHA" for spam protection
  4. Set Layout Options:
    • Choose alignment (left, center, right)
    • Add custom CSS classes if needed

Shortcode Usage

Basic Shortcode

[tourismo-form selectedForm="123"]

Available Options

Option Type Default Description
selected_form string required The ID of the form to display
show_name boolean true Display the form name as heading
show_description boolean true Display the form description
enable_recaptcha boolean true Enable Google reCAPTCHA protection
align string "" Form alignment (left, center, right)
class_name string "" Custom CSS class name

Examples

Basic form with reCAPTCHA:

[tourismo-form selected_form="123" show_name="true" show_description="true" enable_recaptcha="true"]

Form with custom styling:

[tourismo-form selected_form="456" align="center" class_name="custom-form-style"]

Minimal form display:

[tourismo-form selected_form="789" show_name="false" show_description="false"]

Content Displayed

The Form block displays a complete web form with the following elements:

  • Form Title (optional): The name of the form as a heading
  • Form Description (optional): Explanatory text about the form
  • Form Fields: All configured fields from the Tourismo admin platform
  • reCAPTCHA (optional): Google reCAPTCHA verification
  • Submit Button: Button to submit the form

Supported Field Types

  • Text Fields: Single-line and multi-line text input
  • Number Fields: Numeric input with optional min/max values
  • Email Fields: Email address validation
  • Website Fields: URL input with validation for website addresses
  • Date Fields: Date picker with optional date ranges
  • DateTime Fields: Date and time picker
  • Select Fields: Dropdown or radio button selections
  • MultiSelect Fields: Checkbox groups or multi-select dropdowns
  • Boolean Fields: Checkbox for yes/no responses
  • Image Fields: File upload for images with preview

Related Blocks

  • Content Block: For displaying static content alongside forms
  • Title Block: For adding custom headings above forms
  • Description Block: For additional explanatory text

Notes

  • Forms must be created in the Tourismo admin platform before they can be used
  • reCAPTCHA requires configuration in your WordPress settings (see Configuration Guide)
  • Form submissions are processed through the Tourismo platform
  • File uploads support multiple images with preview functionality
  • Date and time fields can be restricted to specific ranges and days
  • Form data is automatically preserved if submission fails, preventing data loss
  • reCAPTCHA uses Google's v2 (checkbox) implementation for user-friendly protection