Automatically run report on Select List update

(2 posts) (2 voices)
  1. cris, Member

    Hi,

    I would like to hide the 'run report' button on the parameter screen and run the report when a selection has been made on the last Select List instead. After over 3 hours of trial and error (I'm completely new to JavaScript), this is the jquery code we came up with for the help/JavaScript box:


    <script>
    $(window).bind('load', function() {
    document.getElementsByClassName("runreport button sub_button")[0].style.display = 'none';
    $('select[name="u3"]').on("change",
    function() {
    setTimeout(function(){document.getElementsByClassName("param_input param_input_pad invisible lightgray in_report_param")[0].submit();}, 250);
    }
    );
    }); </script>

    It works, but I am curious to know if there is a better / cleaner way to accomplish what I'm after.

    Thanks for a great product!

    Cris

  2. myDBR Team, Key Master

    Cris,
    here you go:

    <script>
    $(document).ready(function() {
    $('.runreport').hide();
    $('select[name="u3"]').change( function() {
    $('.runreport').click();
    });
    });
    </script>

    --
    myDBR Team


Reply

You must log in to post.