Automattic / Automattic/jetpack

Form block: Conditional field display

Open
#25,020 1 comment 1 reaction 0 assignees View on GitHub
[Block] Form [Feature] Forms [Pri] Low Enhancement Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### What

Form fields should have a conditional display option.

"If this field is checked then display these fields."

### Why

This would add flexibility to the Form block. Having fields hidden behind conditional display logic would allow the creation of smaller more condensed forms. This is a common feature with form builders.

Example uses:

![Screen Shot on 2022-05-09 at 09:18:22](https://user-images.githubusercontent.com/10353785/167419422-f5a1a910-fd48-4555-8988-419ad87d71de.png)

![Screen Shot on 2022-05-09 at 09:20:05](https://user-images.githubusercontent.com/10353785/167419441-7d872d46-d9e6-4c24-8a13-d0640b21903c.png)

### How

The fields could have a setting for this, [this plugin](https://wordpress.org/plugins/cf7-conditional-fields/) shows this feature for another form solution.

Contributor guide

Open the contributing guide

Research direction

The issue names the Form block but no repository file or test. Start by locating the Form block entry point and compare the linked conditional-fields example; define the supported field relationships and their editor and front-end behavior before implementation. Done means conditional fields can be configured and reliably shown or hidden in a form.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.