[wp-trac] [WordPress Trac] #31909: wp_dropdown_categories() select field cannot accept HTML 'required'

WordPress Trac noreply at wordpress.org
Mon Apr 6 16:26:23 UTC 2015


#31909: wp_dropdown_categories() select field cannot accept HTML 'required'
--------------------------+-----------------------------
 Reporter:  wzislam       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.1.1
 Severity:  normal        |   Keywords:
  Focuses:  template      |
--------------------------+-----------------------------
 === Steps to Reproduce ===

 * Add a `<form>` somewhere in your theme/plugin
 * Call `<?php wp_dropdown_categories(); ?>`
 * Add a `<button>Submit</submit>` button
 * Close the `</form>`
 * Submit the form

 There are no supporting argument that can pass a required option to the
 select field.

 You can't make the select field mandatory without JavaScripts. But HTML5
 has a nice required attribute that supports most of the modern browsers.

 We solved the issue in this WPSE thread:
 http://wordpress.stackexchange.com/q/183292/22728

 But IMHO it's time to have core patch.

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


More information about the wp-trac mailing list