cvs: pear /HTML_QuickForm_advmultiselect advmultiselect.php
[email protected] ("Laurent Laville")
| Newsgroups | php.pear.cvs |
|---|---|
| Message-ID | <cvsfarell1209212675@cvsserver> |
farell Sat Apr 26 12:24:35 2008 UTC
Modified files:
/pear/HTML_QuickForm_advmultiselect advmultiselect.php
Log:
fix bug 13680: XHTML - Need to create a distinct id for all checkboxes
http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_advmultiselect/advmultiselect.php?r1=1.16&r2=1.17&diff_format=u
Index: pear/HTML_QuickForm_advmultiselect/advmultiselect.php
diff -u pear/HTML_QuickForm_advmultiselect/advmultiselect.php:1.16 pear/HTML_QuickForm_advmultiselect/advmultiselect.php:1.17
--- pear/HTML_QuickForm_advmultiselect/advmultiselect.php:1.16 Sat Apr 26 12:21:36 2008
+++ pear/HTML_QuickForm_advmultiselect/advmultiselect.php Sat Apr 26 12:24:35 2008
@@ -36,7 +36,7 @@
* @author Laurent Laville <[email protected]>
* @copyright 2005-2008 Laurent Laville
* @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version CVS: $Id: advmultiselect.php,v 1.16 2008/04/26 12:21:36 farell Exp $
+ * @version CVS: $Id: advmultiselect.php,v 1.17 2008/04/26 12:24:35 farell Exp $
* @link http://pear.php.net/package/HTML_QuickForm_advmultiselect
* @since File available since Release 0.4.0
*/
@@ -558,6 +558,8 @@
$strHtmlSelected = $tab . '<div id="qfams_'.$id.'">' . PHP_EOL;
$unselected_count = count($this->_options);
+ $checkbox_id_suffix = 0;
+
foreach ($this->_options as $option) {
$_labelAttributes
= array('style', 'class', 'onmouseover', 'onmouseout');
@@ -578,11 +580,12 @@
// The item is *unselected* so we want to put it
$checked = '';
}
+ $checkbox_id_suffix++;
$strHtmlSelected .= $tab
. '<label'
. $this->_getAttrString($labelAttributes) .'>'
. '<input type="checkbox"'
- . ' id="'.$selectId.'"'
+ . ' id="'.$selectId . $checkbox_id_suffix.'"'
. ' name="'.$selectName.'"'
. $checked
. $this->_getAttrString($option['attr'])