Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#24732 closed enhancement (fixed)

HTML5 required property to append or replace "aria-required"

Reported by: mmn-o's profile MMN-o Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.6
Component: Comments Keywords: has-patch needs-refresh
Focuses: Cc:

Description

I found it slightly annoying that my browser kept sending the comment forms on my blog even if I forgot to fill out name and email.

Fortunately HTML5 has a property for this, 'required', which can force form fields to be filled before a user's browser submits the form.

Patch is attached that adds HTML5 required statement to required fields in default comment_form function.

It may be an idea also to entirely remove the "aria-required" property, as it is not really standardised.

For what I know, Wordpress tends to have <!DOCTYPE html>, which means the property doesn't need to be " required='required'", but rather just " required".

Both HTML5 and XHTML versions are attached.

Attachments (4)

wp-xhtml-required.patch (3.0 KB) - added by MMN-o 11 years ago.
XHTML patch for comment_form required fields
wp-html5-required.patch (3.0 KB) - added by MMN-o 11 years ago.
HTML5 patch for comment_form required fields
wp-html5-required_for_comment_template.patch (3.0 KB) - added by MMN-o 11 years ago.
HTML5 patch, comment-template.php
wp-xhtml-required_for_comment_template.patch (3.0 KB) - added by MMN-o 11 years ago.
XHTML patch, comment-template.php

Download all attachments as: .zip

Change History (8)

@MMN-o
11 years ago

XHTML patch for comment_form required fields

@MMN-o
11 years ago

HTML5 patch for comment_form required fields

@MMN-o
11 years ago

HTML5 patch, comment-template.php

@MMN-o
11 years ago

XHTML patch, comment-template.php

#1 @MMN-o
11 years ago

  • Component changed from General to Comments
  • Keywords has-patch added

#2 @wonderboymusic
10 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to Future Release

Patch blows up.

#3 @wonderboymusic
10 years ago

  • Milestone changed from Future Release to 4.2

#4 @wonderboymusic
10 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 31204:

In comment_form(), add the HTML5 required attribute next to aria-required in fields that utilize it.

Props MMN-o.
Fixes #24732.

Note: See TracTickets for help on using tickets.