Automattic / Automattic/jetpack

Form Block: Using dots, special characters in the ID fields prevents form validation

Open
#11,831 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Forms [Pri] Normal Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce
1. Starting at URL: Add the "Form Block" and within the form block add the name field and mark it to be required:

screen shot 2019-03-07 at 2 18 01 pm

2. Under Block - Field Settings - Dafault Value, add something like: `Your Name ...`

screen shot 2019-03-07 at 2 19 36 pm

3. Publish your form, go to the site, remove the default values in the name field and add your name as normal:

screen shot 2019-03-07 at 2 21 00 pm

4. Click on Submit

#### What I expected

To see the message that my form has been submitted successfully

#### What happened instead

I got an error that the valid name is required:

screen shot 2019-03-07 at 2 21 08 pm
(on the screenshot I was also testing the email field so the second error is not related to the name field issue)

I thought this might be related to special characters use but signs such as `?` or `<` seem to have worked when set in that field.

#### Context / Source
#user-repor in #1846079-zen

Contributor guide

Open the contributing guide

Research direction

Start with the Form Block's field settings and validation path, then reproduce the issue using a required name field whose default value contains dots or special characters. Compare submission behavior with and without those characters. Done means the submitted name validates normally and the form reports successful submission.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.