[wp-trac] [WordPress Trac] #37540: validateForm does not validate textarea or select inputs

WordPress Trac noreply at wordpress.org
Mon Aug 1 16:30:33 UTC 2016


#37540: validateForm does not validate textarea or select inputs
--------------------------------------------+-----------------------------
 Reporter:  shadyvb                         |      Owner:
     Type:  enhancement                     |     Status:  new
 Priority:  normal                          |  Milestone:  Awaiting Review
Component:  General                         |    Version:  trunk
 Severity:  normal                          |   Keywords:
  Focuses:  ui, javascript, administration  |
--------------------------------------------+-----------------------------
 [https://github.com/WordPress/WordPress/blob/8c82515ab62b88fb32d01c9778f0204b296f3568
 /wp-admin/js/common.js#L79 validateForm] only looks for <input /> elements
 and ignores select and textarea fields.

 '''Steps to reproduce:'''

 - Add a select or textarea input to term edit page/form, add 'form-
 required' class to their wrappers
 - Leave the new field(s) empty
 - Click the submit button

 '''Expected behavior:'''

 - Form is not submitted, because required fields are not filled out

 '''Actual result:'''

 - Form validation passes and form is submitted

 '''Recommended change:'''

 - Change {{{ input:visible }}} to {{{ :input:visible }}} so it covers
 select and textarea as well.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37540>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list