WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#47728 closed enhancement (duplicate)

Comment's form displaying validation message on the same page instead of directing user to new page & displaying errors.

Reported by: AkSDvP Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: Cc:

Description

On any Page/Post, while adding a comment if in case of validation error user is redirected to new page & error messages are displayed.
Instead, it would be more user-friendly if the user is not directed to new page & error messages are displayed on the page itself, probably before form title.

Attachments (3)

Comment-Error2.png (107.3 KB) - added by AkSDvP 2 years ago.
Snapshot with Error Messages displayed on other page after form data is being validated.
name-required.png (114.5 KB) - added by pento 2 years ago.
Comment-Error1.png (114.2 KB) - added by AkSDvP 2 years ago.
Snapshot to view default comments form for reference.

Download all attachments as: .zip

Change History (9)

@AkSDvP
2 years ago

Snapshot with Error Messages displayed on other page after form data is being validated.

@pento
2 years ago

#1 follow-up: @pento
2 years ago

  • Keywords reporter-feedback added

Thank you for the bug report, @AkSDvP!

comment_form() adds the required attribute to the <input> fields, so your browser should show a warning when they're not filled out.

Are you able to reproduce this lack of client-side warning on a site using a default theme, and no plugins?

#2 @AkSDvP
2 years ago

@pento Yes, I was able to reproduce the same issue by deactivating all plugins & using the twentynineteen theme.
Actually, I am testing this functionality on my local machine & it is the development environment. This issue was noticed in earlier versions as well.

For reference: I am testing it on Chrome Browser (Version 64.0.3282.140 (Official Build) (64-bit)) & Ubuntu OS.

@AkSDvP
2 years ago

Snapshot to view default comments form for reference.

#3 @AkSDvP
2 years ago

  • Keywords needs-patch dev-feedback added; reporter-feedback removed

#4 @SergeyBiryukov
2 years ago

Previously: #4332

#5 @AkSDvP
2 years ago

  • Keywords dev-feedback removed

#6 in reply to: ↑ 1 @SergeyBiryukov
2 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @AkSDvP, welcome to WordPress Trac! Thanks for the ticket.

Replying to pento:

comment_form() adds the required attribute to the <input> fields, so your browser should show a warning when they're not filled out.

It does add the required attribute, however it also has the novalidate attribute on the form, which prevents client-side validation from being performed due to concerns about browsers implementing validation in very different ways, per discussion in #15080.

We're now re-evaluating that decision in #47595, let's continue the discussion there.

Note: See TracTickets for help on using tickets.