CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    144

    How to submit iframe in current page

    Hello , i have index.php and somewhere inside it i have an iframe of index2.php , index2.php has this code

    Code:
    <a href="javascript:{}"  target="_parent" onclick="document.getElementById('form1').submit(); return false;">Submit</a>
    but when i click it , the page loads inside the iframe , so im still at index.php but i have iframe with different content.... how can i manage "load" the page at index.php window ?

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: How to submit iframe in current page

    Couple issues.

    1. Your href attribute is invalid JavaScript. That should be throwing errors in some browsers.
    2. Since it's submitting a form, changing the target in the actual anchor tag will do nothing.

    Code:
    <a href="#" onclick="document.getElementById('form1').submit(); return false;">Submit</a>
    
    <form target="_parent" ... >
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured