From 029b8ed2b1e039d216fc974db413cd5f3f718a3d Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Wed, 30 Jan 2019 09:27:37 +0100 Subject: [PATCH] ids.cgi: Show/Hide subscription code area dynamically. Dynamically (Java Script) show/hide the area for entering the subscription code / oinkcode based on the choosen ruleset. Signed-off-by: Stefan Schantl --- html/cgi-bin/ids.cgi | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index fa5bf2399d..6fbc0b7b79 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -612,6 +612,22 @@ $selected{'AUTOUPDATE_INTERVAL'}{$rulessettings{'AUTOUPDATE_INTERVAL'}} = "selec ### Java Script ### print < + // JQuery function to show/hide the text input field for + // Oinkcode/Subscription code. + \$(function() { + \$('#RULES').change(function(){ + if(\$('#RULES').val() == 'registered') { + \$('#code').show(); + } else if(\$('#RULES').val() == 'subscripted') { + \$('#code').show(); + } else if(\$('#RULES').val() == 'emerging_pro') { + \$('#code').show(); + } else { + \$('#code').hide(); + } + }); + }); + // Tiny java script function to show/hide the rules // of a given category. function showhide(tblname) { @@ -780,7 +796,7 @@ print < - @@ -801,8 +817,8 @@ print <

- - Oinkcode:  + + Oinkcode:  -- 2.39.2