summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usr/local/www/classes/Form/Group.class.php4
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js8
2 files changed, 11 insertions, 1 deletions
diff --git a/src/usr/local/www/classes/Form/Group.class.php b/src/usr/local/www/classes/Form/Group.class.php
index 9005a0d..ae0a155 100644
--- a/src/usr/local/www/classes/Form/Group.class.php
+++ b/src/usr/local/www/classes/Form/Group.class.php
@@ -154,7 +154,9 @@ EOT;
// 'element-required'. Text decoration can then be added in the CSS to indicate that this is a
// required field
if (substr($title, 0, 1 ) === "*" ) {
- $title = '<span class="element-required">' . substr($title, 1) . '</span>';
+ $title = '<span class="element-required">' . substr($title, 1) . '</span>';
+ } else {
+ $title = '<span>' . $title . '</span>';
}
}
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js
index 2eac30a..1dff7fa 100644
--- a/src/usr/local/www/js/pfSenseHelpers.js
+++ b/src/usr/local/www/js/pfSenseHelpers.js
@@ -20,6 +20,14 @@
// These helper functions are used on many/most UI pages to hide/show/disable/enable form elements where required
+// Cause the input to be displayed as a required field by adding the element-required class to the label
+function setRequired(id, req) {
+ if (req)
+ $('#' + id).parent().parent('div').find('span:first').addClass('element-required');
+ else
+ $('#' + id).parent().parent('div').find('span:first').removeClass('element-required');
+}
+
// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
function hideInput(id, hide) {
if (hide)
OpenPOWER on IntegriCloud