[wp-trac] [WordPress Trac] #16539: Duplicate search widgets cause ID conflicts

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 13 06:03:41 UTC 2011


#16539: Duplicate search widgets cause ID conflicts
------------------------------------+------------------------------
 Reporter:  solarissmoke            |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Widgets                 |     Version:  3.0
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+------------------------------

Comment (by kurtpayne):

 Thanks for all the feedback on this.

 [attachment:16539_searchform.2.2.diff] should meet all the criteria
 mentioned above.  Didn't tick the "overwrite existing" so that's why
 there's a dupe, sorry about that.

 This patch has a static function variable as @SergeyBiryukov suggested.
 It also has the first form with an id of "searchform" as @azaozz suggested
 (with text input and submit ids of "s" and "searchsubmit" respectively)
 and subsequent forms, texts, and submits using and id with a counter as
 @ryanimel suggests.

 It also has a class of searchform as @nacin suggested.  The form and
 submit ids are possible to remove, but the label and and text ids are
 linked via the label, so the id counter is still necessary.  For example:
 `<label for="s-0"><input id="s-0" />`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16539#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list