[wp-trac] [WordPress Trac] #49039: JavaScript/jQuery validation for comment form

WordPress Trac noreply at wordpress.org
Fri Dec 20 05:45:20 UTC 2019


#49039: JavaScript/jQuery validation for comment form
-------------------------+------------------------
 Reporter:  guddu1315    |       Owner:  (none)
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Comments     |     Version:  5.3.1
 Severity:  normal       |  Resolution:  duplicate
 Keywords:               |     Focuses:  ui
-------------------------+------------------------

Comment (by subrataemfluence):

 Since @SergeyBiryukov has said that further discussion should be made in
 #47595, I would just like to share my thoughts:

 1. The attribute `required` is now been used in most websites these days
 since HTML5 is now has become the most used one if not the only. So I
 don't find any negative in using this attribute over JavaScript
 validation.

 2. If `required` is the solution, it will only be implemented in the
 upcoming release and won't be incorporated in older versions of WordPress.
 Sites developed in **5.3.x** will always use `HTML5`. Bootstrap uses
 `HTML5`. Modern sites are being developed targeting modern browsers only.

 3. We also need to remember that a lot of `CSS` rules we are using these
 days were not previously supported by older browsers. If we take such
 older browsers into consideration, we have to go back to the old CSS
 writing styles as well.

 I apologize for replying in this ticket.

 Replying to [comment:2 guddu1315]:
 > Replying to [comment:1 subrataemfluence]:
 > > Rather than adding JavaScript validation, what if we go with
 `required` attributes for mandatory fields.
 >
 > Hi @subrataemfluence
 >
 > But considering the old browsers compatibility
 (https://caniuse.com/#feat=mdn-api_htmlinputelement_required), JavaScript
 validation would be a better option.
 >
 >
 > According to https://caniuse.com/#feat=mdn-api_htmlinputelement_required
 > the browser that don't support **required** attribute and still in usage
 is around **27%**
 >
 > 27% is a very high number. So that is definitely not an option.
 >
 > Thanks

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49039#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list