diff --git a/omod/src/main/webapp/run/runReportForm.jsp b/omod/src/main/webapp/run/runReportForm.jsp index 83e31fce8d..9259b9e18f 100644 --- a/omod/src/main/webapp/run/runReportForm.jsp +++ b/omod/src/main/webapp/run/runReportForm.jsp @@ -20,6 +20,23 @@ jQuery(document).ready( function toggleInputElements( idPrefix ){ jQuery( '.'+idPrefix ).toggle(); } + +/** + * TODO make disableButtons(idPrefix) an external function so that when widgets are + * used elsewhere but not in the Reporting module, they can access it. + */ +var disableButtons = function(idPrefix) { + var checkFixedValue; + checkFixedValue = jQuery('.' + idPrefix).val().length; + var checkExpression; + checkExpression = jQuery('#inputExpression.' + idPrefix).val().length; + + if (checkFixedValue > 0 || checkExpression > 0) { + jQuery('.' + idPrefix + '.smallButton').attr("disabled", "disabled"); + } else if (checkFixedValue == 0 || checkExpression == 0) { + jQuery('.' + idPrefix + '.smallButton').removeAttr("disabled"); + } + }