XXDebugger
XXDebugger

Reputation: 1581

Add a pop up wait message in form action

I have a form action which generates the report. I want to add a message pop up like Please wait the report is loading

How can I do this in js.

 <form action="step50/generateReport" method="GET" id="form_generate">
      <input style="margin-top: 20px;" type="submit" id="btnGenerate"  value="Generate"/>      
</form>

I am trying this:

function popupProcessStatus(){                        
              $.fancybox({href:'#display_status_inline', closeBtn: true, helpers:{overlay: {closeClick:false}}});                            
        }

<div id="display_status_inline" style="display: none">     
            <br>
            <p>Please wait until the report is generated.</p>                                               
        </div> 

But not sure where to call this function so as to display this when the btn is clicked and go off when the report is generated.

Upvotes: 0

Views: 54

Answers (1)

Saar
Saar

Reputation: 2306

just call the function on submit:

var form = document.getElementById("form_generate");
form.addEventListener("submit",popupProcessStatus,false);

Upvotes: 1

Related Questions