2 Replies Latest reply: Oct 23, 2013 1:00 PM by DanielPauletti RSS

    auto submit page

    tparvaiz

      Hi,

       

      I have a radio group that shows a sequence (something like this 1  2  3  4  5  6)... when user selects a number, page gets submitted to update reports according to the selection...

       

       

      what I want is an additional functionality to allow auto submit page after every 5 seconds with the above mentioned sequence... I am imagining something like a check box, if it's checked then page should be submitted automatically:

       

      1) in the first instance P2_ITEM value should be set to 1 and then page should be submitted

      2) after 5 seconds  P2_ITEM value should become 2 and then page should be submitted

      3) after 5 seconds  P2_ITEM value should become 3 and then page should be submitted

       

      and so on until last value

       

      can you please advice (with details as how to accomplish it)

       

      Thanks

        • 1. Re: auto submit page
          tparvaiz

          anyone?

          • 2. Re: auto submit page
            DanielPauletti

            Hi.

             

            You could try javascript.

            I imagine that you have a radio group P2_ITEM. Now create a checkbox item called P2_AUTO.

            Declare this function in javascript section:

            function verify(){
              if($('#P2_AUTO_0').attr('checked')){
                if($v('P2_ITEM') < 6){
                  $s('P2_ITEM',parseInt($v('P2_ITEM'))+1);
                }else{
                  $s('P2_ITEM',1);
                }
                window.doSubmit();
              }
            }
            

             

            On page load use the function:

            var interval = setInterval('verify()',5000);
            

             

            With this JS code your page will be submitted each 5 seconds when your P2_AUTO is checked.

             

            I hope it's useful.