0

Ok my code is as follow:

<body>
<iframe>
<script>
$(function( {
 $('form).submit();
});
</script>
<form>
<input type="file" name="myfile"/>
</form>
</iframe>
</body>

this is an iframe inside another page which has a form with upload files inside submitted via jQuery.

Now i'm wondering if it's possible to hide the page loading when the form is submitted, since i'm into another page and not into the iframe page directly.

enter image description here

^ remove this animation from browser when iframe form is submitted

2 Answers 2

0

Yes it can be done but instead you submit the form you should call post service from jquery to hide loding on page

Sign up to request clarification or add additional context in comments.

8 Comments

are you talking about using Ajax? i can't use ajax, i can only submit form sync not async
check i edited my example, i have file inputs inside the form so i can't use ajax to send them
you should set your return value to false in ajax call.. this link may help your case stackoverflow.com/questions/13971769/…
i 'm not using Ajax, i'm submitting form using submit()
and i can't use ajax with input file
|
0

Your script inside the iframe, should be:

$(function() {
  $('form').submit();
});

That wouldn't have executed otherwise.

The way you are using text inside the frame, is for when Javascript is disabled on the client.

You can come across some problems also with frames. Can you not load the page contents into a DIV?

1 Comment

i wrote the iframe content in the example, in reality i add an src="" attribute to the iframe to load the source content, and my code alrady looks like you showed above ;)

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.