If you are unable to create a new account, please email support@bspsoftware.com

 

Javascript used to refresh radio button prompt selected value

Started by raamzs, 10 Jun 2016 08:01:01 AM

Previous topic - Next topic

raamzs

we have a a piece of script used to refresh the prompt page upon value selection in radio button prompt which is working fine in 10.2.2 version but after upgrade to 11.0.2 this functionality is not working.

<script type="text/javascript">
            var inputs = document.getElementsByTagName("input");
            var list_box = new Array();

            var radio_buttons = new Array();
            j=0;

            for(i=0;i<inputs.length;i++)
            {
                        if(inputs.type=='radio')
                        {
                                    radio_buttons[j] = inputs;
                                    j++;
                        } 
            }

            radio_buttons[0].setAttribute("onclick",function(){refreshPage();});
            radio_buttons[1].setAttribute("onclick",function(){refreshPage();});

            function refreshPage()
            {
                        if(radio_buttons[0].checked)
                        {
                        setTimeout(nameSpace + '.promptAction(\'reprompt\')', 100);
                        }
           
            if(radio_buttons[1].checked)
                        {
                        setTimeout(nameSpace + '.promptAction(\'reprompt\')', 100);
                        }
            }
</script>

based on selection of the values next prompt gets refreshed. I tried parameter casecade association but did not work.
is there any way to use list.onchange= function_name or any other solution will be helpfull.

Thanks in advance !!!

k2

Hi Raamzs,
Am currently looking to implement similar radio button prompt to refresh the page based on selection. Grateful if you could share the list of java scripts for version 10.2 or 8.4 and steps to implement.

Clip board copy of the report could also be a great help. Thanks

Christian85

Quote from: raamzs on 10 Jun 2016 08:01:01 AM
we have a a piece of script used to refresh the prompt page upon value selection in radio button prompt which is working fine in 10.2.2 version but after upgrade to 11.0.2 this functionality is not working.
Hi!

Did you disable the interactive mode (report settings)? Otherwise Javascript won't work in 11.0.2 and your HTML-Items will be removed when you run your report.

In R4 a new component has been added ('Custom Control') to use Javascript and the interactive mode together (instead of the HTML-Item).

In case this is not the problem some console output won't hurt.

Chris