Required field fails validation when autocompleted and disabled, even when "Submit disabled field value(s)" checked

Created on 20 November 2023, 7 months ago
Updated 17 May 2024, about 1 month ago

1.0 Problem/Motivation
Fields will fail validation if they:

  • Are required,
  • Are autocompleted by an Existing Contact selection, and
  • Are locked (disabled) when autocompleted

Checking "Submit disabled field value(s)" sounds like it should solve the problem, but it doesn't.

2.0 Detailed steps to reproduce (embed screenshots)
Import the attached webform YAML, or:

  • Create a new webform
  • Enable CiviCRM processing and press Save settings
  • Switch to the Build tab and edit the Existing Contact element
  • Change the widget type to Autocomplete
  • In the Default value section, choose Set default contact from: - None -
  • In the Contact Field Handling section, choose Fields to Lock: Name
  • Locked fields should be: Disabled
  • Check the "Submit disabled field value(s)" box
  • Save
  • Check the "Required" box for Existing Contact, First Name, and Last Name
  • Save
  • View the webform
  • Search in the Existing Contact field and select a contact
  • Try to submit the form, noting that the disabled fields contain data and "Submit disabled field value(s)" has been selected
  • Observe that it fails with these messages:

First Name field is required.
Last Name field is required.

3.0 Proposed resolution
I haven't figured out the solution, but the desired end result is to be able to require these fields which may be filled and disabled by the autocomplete widget.

πŸ› Bug report
Status

Active

Version

6.2

Component

Webform/Drupal

Created by

πŸ‡¦πŸ‡ΊAustralia jude.hungerford

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

Comments & Activities

Production build 0.69.0 2024