diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-14 11:39:44 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-14 11:39:44 -0500 |
commit | 53eac591b6e0c6fa6b856cabc8a147834cc1683a (patch) | |
tree | 432dcba72dd4403fc71dd5b1018017b3d9f90e97 /src/usr | |
parent | 4f446437b5bb536941d1be1b311cee37bdfb1750 (diff) | |
parent | 94826107ee5c94fcf993f4bd8cbf954aea1ef13d (diff) | |
download | pfsense-53eac591b6e0c6fa6b856cabc8a147834cc1683a.zip pfsense-53eac591b6e0c6fa6b856cabc8a147834cc1683a.tar.gz |
Merge pull request #2216 from NOYB/HTML_Compliance_-_Checkbox_Display_As_Radio_Unique_ID
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/classes/Form/Checkbox.class.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/usr/local/www/classes/Form/Checkbox.class.php b/src/usr/local/www/classes/Form/Checkbox.class.php index e0734de..d94c210 100644 --- a/src/usr/local/www/classes/Form/Checkbox.class.php +++ b/src/usr/local/www/classes/Form/Checkbox.class.php @@ -46,10 +46,16 @@ class Form_Checkbox extends Form_Input $this->column->addClass('checkbox'); } - public function displayAsRadio() + public function displayAsRadio($id = null) { $this->_attributes['type'] = 'radio'; + if ($id != null) { + $this->_attributes['id'] = $id; + } else { + $this->_attributes['id'] = $this->_attributes['name'] . '_' . $this->_attributes['value'] . ':' .substr(uniqid(), 9); + } + return $this; } |