summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/classes
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2015-12-13 00:51:42 -0800
committerNOYB <Al_Stu@Frontier.com>2015-12-13 00:51:42 -0800
commit94826107ee5c94fcf993f4bd8cbf954aea1ef13d (patch)
treee3d77086ecfa97569ca88e1a4437e0de244481ae /src/usr/local/www/classes
parentb21e40099d85fa0a83e4d8fc87721e0a7559cdab (diff)
downloadpfsense-94826107ee5c94fcf993f4bd8cbf954aea1ef13d.zip
pfsense-94826107ee5c94fcf993f4bd8cbf954aea1ef13d.tar.gz
HTML Compliance - Checkbox Display As Radio Unique ID
Ensure checkbox display as raido has unique id. Allow an id to be passed in displayAsRadio() as argument[0]. If no argument is passed, construct id as name_value:uniqid. Previous behavior was id = name. So all the radio buttons of the set had same id.
Diffstat (limited to 'src/usr/local/www/classes')
-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