Fix ids for multi-select types
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 24 Apr 2009 11:11:44 +0000 (11:11 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 24 Apr 2009 11:11:44 +0000 (11:11 +0000)
includes/HTMLForm.php

index 0db6980..f77ff4c 100644 (file)
@@ -664,8 +664,8 @@ class HTMLMultiSelectField extends HTMLFormField {
                                $html .= $this->formatOptions( $info, $value );
                        } else {
                                $checkbox = Xml::check( $this->mName.'[]', in_array( $info, $value ),
-                                                               array( 'id' => $this->mID, 'value' => $info ) );
-                               $checkbox .= '&nbsp;' . Xml::tags( 'label', array( 'for' => $this->mID ), $label );
+                                                               array( 'id' => $this->mID."-$info", 'value' => $info ) );
+                               $checkbox .= '&nbsp;' . Xml::tags( 'label', array( 'for' => $this->mID."-$info" ), $label );
                                
                                $html .= Xml::tags( 'p', null, $checkbox );
                        }