0

I have a simple form where people fill in some data. When pressed the submit button this data will be handelded in a php script, this takes some time (10 seconds). When the php script is finished it will give his result into a iframe.

Now I want a loading image on this iframe while the php script is running. So how can I trigger the loading image when the submit button is pressed and that the image will be go away when the iframe is fully loaded.

Here is a Jsfiddle of my form: http://jsfiddle.net/#&togetherjs=oFhTbTvn2d

Has someone a Jsfiddle example of something that looks like I want?

Thanks in advance!

3
  • possible duplicate of Showing a loading image while loading php script Commented Mar 20, 2014 at 20:30
  • your goal is to just technically show a loader (whether it's loading or not doesn't matter). Once the data is loaded, you can just cover or empty the loading gif. Commented Mar 20, 2014 at 20:30
  • You should load the results using an AJAX request instead of an iframe. Show the image when you trigger the AJAX request, then hide it when you get a response. That is the best way to do what you're asking. Commented Mar 20, 2014 at 20:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.