summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-12-14 11:39:44 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-12-14 11:39:44 -0500
commit53eac591b6e0c6fa6b856cabc8a147834cc1683a (patch)
tree432dcba72dd4403fc71dd5b1018017b3d9f90e97 /src/usr
parent4f446437b5bb536941d1be1b311cee37bdfb1750 (diff)
parent94826107ee5c94fcf993f4bd8cbf954aea1ef13d (diff)
downloadpfsense-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.php8
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;
}
OpenPOWER on IntegriCloud