summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-02-10 09:00:28 -0500
committerSteve Beaver <sbeaver@netgate.com>2017-02-10 09:12:08 -0500
commit5f6c371293db76776600a40c940c9a14d4054642 (patch)
tree004c1a7e07757549a401ec1ae6bf4cc312cbe7e9 /src
parent5b18b8a4e0b79e8502ceb5d7bc01a7c0383f0c0e (diff)
downloadpfsense-5f6c371293db76776600a40c940c9a14d4054642.zip
pfsense-5f6c371293db76776600a40c940c9a14d4054642.tar.gz
Provide Javascript set_Required function
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js
index d98a50a..341c3bb 100644
--- a/src/usr/local/www/js/pfSenseHelpers.js
+++ b/src/usr/local/www/js/pfSenseHelpers.js
@@ -52,6 +52,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