www.webdeveloper.com
Results 1 to 3 of 3

Thread: Iframe load file on src only when form is submit

  1. #1
    Join Date
    Jul 2012
    Posts
    12

    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:

    HTML 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

  2. #2
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    Try to let empty the src attribute of <iframe> (or add the URL of a blank page).
    Code:
    <iframe id="target" name="target" src="" style="display:none;"></iframe>
    Last edited by MarPlo; 08-15-2012 at 08:18 AM.

  3. #3
    Join Date
    Jul 2012
    Posts
    12
    Quote Originally Posted by MarPlo View Post
    Hi,
    Try to let empty the src attribute of <iframe> (or add the URL of a blank page).
    Code:
    <iframe id="target" name="target" src="" style="display:none;"></iframe>
    yeh it works, thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles