Cab Grid Pro comes with a built-in booking form. Further custom fields can be added, but there is a set of pre-defined form fields. Most of the built-in form fields are mandatory and must be completed by the customer for the booking request to be submitted. There are occasional circumstances where the built-in form fields are superfluous or not required. In these cases, they can be made optional (not mandatory) and hidden from customer view. This is done by editing Cab Grid Pro plugin files directly (or through an add-on plugin) as follows.

Step 1: Make unnecessary fields optional

NOTE: Disabling validation of built-in fields is NOT recommended. Missing input can break Cab Grid features – especially if add-ons such as Booking Management and Stripe are installed and activated.

Additional settings can be defined in a special Cab Grid Pro file named _settings.php. This file is found within the Cab Grid Pro plugin folder. It offers a number of advanced custom configuration options. Because the built-in _settings.php file is updated each time Cab Grid Pro is updated, it is preferential to use a separate add-on plugin to define custom settings. The free Defaults Add-on is available for this purpose. For detailed information, please see our support article, “Advanced Settings for Cab Grid Pro – Defaults add-on plugin“. There are two ways to edit these settings. Either via the WordPress Admin (assuming sufficient privileges are assigned e.g. admin rights) or by downloading the file from the web server, editing it with a text editor, and then re-uploading it via FTP. For step by step instructions, please see, “How to edit buttons & field labels using WordPress” The table below describes the settings that control built-in form field validation.

Step 2: Hide optional built-in form fields

Once unnecessary built-in form fields have been made optional they can be hidden from view. To do this, dedicated CSS styles must be added to the ‘Styling CSS’ box in the Cab Grid Pro WordPress Admin panel (WordPress Admin > Cab Grid Pro > OPTIONS > Styling CSS). For more details please see our article about making basic style changes with CSS. The table below shows the CSS required to hide each field. Note, hidden fields are still included in messages sent by Cab Grid but their values will be empty. This can be avoided by creating dedicated custom email messages where possible.

Disable validation on hidden fields automatically

In some circumstances you may want to make a form field optional but still have it visible (or available for the customer to complete if they choose). For example, email address or telephone number. This can be achieved by disabling the validation via the method described in Step 1 (on the left).

However, it is now possible (from Cab Grid Pro v5.5.4) to make hidden booking form fields optional without needing to disabled validation as described in Step 1.

To do this, a booking form field would be hidden using CSS as described in Step 2 (left) and the table below (Hide CSS column). When Cab Grid Pro detects the field’s parent container (LI tag) is hidden, it will remove the mandatory (required) attribute automatically allowing the form to be submitted without any content entered in the targeted field.

Settings Table

Built-in Mandatory Fields Settings Variable Hide CSS
1. Pick up date and time $cabGridProPickupDateOptional="y"; .cabGridPro .cgpPickupDate {display:none !important;}
2. Return date and time (if return journey selected) $cabGridProReturnDateOptional="y"; .cabGridPro .cgpReturnDate {display:none !important;}
3. Customer name $cabGridProNameOptional="y"; .cabGridPro .cgpBookFormName {display:none !important;}
4. Customer telephone number $cabGridProTelOptional="y"; .cabGridPro .cgpBookFormTel {display:none !important;}
5. Customer email address $cabGridProEmailOptional="y"; .cabGridPro .cgpBookFormEmail {display:none !important;}
6. Exact pickup address $cabGridProPickupAddressOptional="y"; .cabGridPro .cgpPickLI {display:none !important;}
7. Exact destination address $cabGridProDestAddressOptional="y"; .cabGridPro .cgpDestLI {display:none !important;}

Cab Grid Pro Built-in Form Fields

Tags: , ,