Skip to main content

Hidden and custom fields

It's important to have a stored_ prefix in the field name, otherwise it will not be added into the payment object.

Adding hidden fields

If you need to add a hidden fields to a transaction just add it to the paymentFormPrefill config option.
This field will be added to a transaction with a value 'my value'.

Adding custom fields into slots

As described in the Dynamic components guide, the one of the component supported types is field. You can use it to add a custom fields of various types into the form.

Supported types for a field component are:

  • text
  • textarea
  • date
  • radio-group
  • radio-in-group
  • checkbox-group
  • checkbox-in-group
  • checkbox
  • select
  • select-salutations
  • select-countries
  • select-states

You can define default values for custom fields using paymentFormPrefill config option:

All custom fields can be validated the same way as Tamaro standard fields with the same validation rules. You need to specify desired validation rule for them using paymentValidations config option:

Adding a text, textarea, date fields

In the example below:

  • A custom text field stored_custom_text_field is added to the profile_form_start slot.
  • The field is required since we added a validation rule.
  • When supporter clicks on the info-icon with "Show more info" aria-label, the HTML content is expanded with specified content.

Adding a radio-group and radio-in-group fields

In the example below:

  • A custom radio group fields stored_contact_via are added to the profile_form_start slot.
  • The field is required since we added a validation rule.

Adding a checkbox-group and checkbox-in-group fields

In the example below:

  • A custom checkbox group fields stored_contact_via are added to the profile_form_start slot.

Adding a checkbox fields

In the example below:

  • A custom checkbox field stored_customer_accept_terms is added to the custom slot_1 block.
  • The field is required since we added a validation rule.

Adding a select fields

In the example below:

  • A custom select field stored_contact_via are added to the profile_form_start slot.
  • The field is required since we added a validation rule.

Adding a select-salutations, select-countries and select-states fields

In the example below:

  • A custom fields stored_member_salutation, stored_member_country and stored_member_state are added to the custom slot_1 block.

  • The fields are required since we added a validation rules.

  • The fields stored_member_state depends on the value of the stored_member_country field, it's shown only when selected country has some defined states, which is currently defined only for:

    • United States of America
    • Canada
    • Chile
    • Argentina