WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 6 years ago

#22792 closed enhancement (fixed)

Cannot change name attribute of comment submit button

Reported by: willi828 Owned by: wonderboymusic
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.4.2
Component: Comments Keywords: has-patch
Focuses: template Cc:

Description

This prevents developers from using client-side validation, as the name attribute being set to "submit" interferes with the .submit() method. I can change the id and the label of the submit button, but that is all.

The default WordPress server-side validation is unacceptable from a user-experience standpoint.

This would be the solution for me, which I find cumbersome (http://wordpress.stackexchange.com/questions/65001/error-when-posting-comment-form-the-error-is-typeerror-eh-is-not-a-function).

The developer should be allowed to set the name attribute of the submit button (maybe through the use of comment_form()).

Attachments (2)

22792.diff (2.0 KB) - added by aubreypwd 6 years ago.
Patch to add name_attr to change the name attribute
22792.2.diff (2.0 KB) - added by obenland 6 years ago.

Download all attachments as: .zip

Change History (13)

#1 @willi828
8 years ago

  • Type changed from feature request to defect (bug)

I'm changing this type to a bug as "submit" is a namespace that shouldn't be used.

This ticket was mentioned in IRC in #wordpress-dev by aubreypwd. View the logs.


6 years ago

@aubreypwd
6 years ago

Patch to add name_attr to change the name attribute

#3 @aubreypwd
6 years ago

  • Keywords has-patch added

#4 @aubreypwd
6 years ago

  • Keywords needs-docs added; has-patch removed

#5 @aubreypwd
6 years ago

  • Keywords has-patch added

#6 @DrewAPicture
6 years ago

  • Focuses template added
  • Keywords dev-feedback added; needs-docs removed

22792.diff looks good to me. Could use dev feedback on whether this is a possibility for merge.

#7 @SergeyBiryukov
6 years ago

I'd suggest name_submit as the argument name, for consistency with id_submit.

@obenland
6 years ago

#9 @obenland
6 years ago

  • Keywords dev-feedback removed
  • Type changed from defect (bug) to enhancement

Agreed. Refreshed patch.

#10 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 4.0

#11 @wonderboymusic
6 years ago

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

In 28813:

In comment_form(), allow name_submit to be passed to change the name attribute of the submit button.

Props obenland.
Fixes #22792.

Note: See TracTickets for help on using tickets.