#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    35
    Rep Power
    3

    Iframe load file on src only when form is submit


    Well the title says the problem.

    I have a form and an iframe, like this:

    Code:
    <form action="image.php" method="post" enctype="multipart/form-data" target="target">
    <input id="file" type="file" name="file"/> 
    <input id="submit" type="submit" name="submit" value="Submit"/>
    </form>
    <iframe id="target" name="target" src="image.php" style="display:none;"></iframe>
    I need to only load the src file on iframe when the form is submited and not when the page is loaded.

    How can i resolve this?

    Thanks Community
    Last edited by Alex1234; August 15th, 2012 at 07:36 AM.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    Set the initial src of the iframe to "about:blank".
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo