Allow changing the 'Send message' contact form string and optionally hiding the preview button

Created on 17 March 2016, about 9 years ago
Updated 17 May 2025, 1 day ago

Problem/Motivation

Submit message button is hardcoded but there are other uses for contact forms.
Preview button always displays but sometimes you don't want it.

Proposed resolution

Add new properties to ContactForm entity - button text and show preview
Add these to the contact form schema
Add new fields to edit form to set the values
Alter the message form to use these new values to set the button text and preview visibility
Test coverage

Remaining tasks

All of the above
You can borrow elements from contact storage module

User interface changes

New form options in contact form edit form

API changes

None

Data model changes

None

Original report

We would like to request more options to edit the buttons through the Contact Form UI in Drupal 8:

Request #1: We would like to change the text of the contact form's submit button from "Send Message" to something else within the UI since we'd hope to use this module for several diverse small forms on our site. For instance, we have one form that's a Demo Download so "Get Download" makes more sense.

Request #2: We would like to either hide or remove the preview button within the UI as it's not always needed on our forms.

✨ Feature request
Status

Postponed

Version

11.0 πŸ”₯

Component

contact.module

Created by

πŸ‡ΊπŸ‡ΈUnited States katannshaw Kansas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024