From: Stefan Schantl Date: Wed, 30 Jan 2019 08:27:37 +0000 (+0100) Subject: ids.cgi: Show/Hide subscription code area dynamically. X-Git-Tag: v2.23-core131~117^2~92 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=029b8ed2b1e039d216fc974db413cd5f3f718a3d 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 --- 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: