Problem/Motivation
We have core module "Inline form errors". Once this module enabled and ajax validation enabled in webform - it's making sense to not display status messages inside of form at all (instead, there is already inline errors displayed).
Steps to reproduce
1. Standard profile installation
2. Enable Inline form errors core module
3. Install and enable contrib Webform and Webform UI modules
4. Go to the settings of default webform "Contact" and enable "use Ajax" setting.
5. View Contact form and for example in one of the required text fields fill empty space " ", then click on Submit.
You will see inline form errors + status messages
Proposed resolution
Add one more validation setting in webform, like this:

and remove display of status messages in case if this setting is TRUE
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | disableStatusMessageCheckBox.png | 11.88 KB | aditi saraf |
| #3 | 3395218.patch | 4.79 KB | kostyashupenko |
| Screenshot from 2023-10-19 17-22-56.png | 17.06 KB | kostyashupenko |
Issue fork webform-3395218
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
cilefen commentedComment #3
kostyashupenkoI'm not backender, but this patch already can help a lot (at least it's really disabling status messages for your forms)
Also user brolad helped with this
Comment #5
aditi saraf commentedi am Not able to reproduce it , not getting Disable status message checkbox .
Comment #6
jrockowitz commentedI am very hesitant to add any new features to the Webform module.
This feature can be handled in a very simple form alter hook that detects an Ajax request.
Comment #7
kostyashupenkoI can't agree @jrockowitz
Displaying of status messages is hardcoded in webform with no ability to get rid of it quickly.
Guess how many different webforms can exist on the web-site, then guess
Inline form errorsmodule enabled. Then guess 70% of the webforms shouldn't have status messages. Then guess how many alter hooks need to write.Comment #8
andypostThere's JS API for messages https://www.drupal.org/node/2930536
Comment #9
jrockowitz commentedRemoving the 'status_messages' can also be accomplished in form alter hook in custom module or theme.