Skip to content

Use webform element's name attribute (if set) as field key/name #1410

@bgilhome-now

Description

@bgilhome-now

Describe the feature

Currently in the webform mapping, the webform element's machine name (e.g. my_field) is used as the HTML input's name attribute. It would be good if the mapping could support using the name attribute set in the webform element's config if it's filled (e.g. myCustomFieldName).

Motivation

This is handy for webforms which submit to an API endpoint or other external service, which might use parameters with camel case or other cases (not snake case like machine names).

Proposal

Update the webform mapping to support using the name attribute if set in webform element config.

Benefits

Easier integration for forms with handlers using external APIs or other services.

Drawbacks

Will have to check if any existing code e.g. for regular handlers expects names to be snake case.

Adoption strategy

Add to documentation.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be created outside of Ripple-framework as a layer?

Final checks

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions