1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with iframe redirect after clicking submit

Discussion in 'HTML & JavaScript' started by MikeHustle, Jan 29, 2011.

  1. MikeHustle

    MikeHustle Power Member

    Joined:
    Mar 1, 2009
    Messages:
    634
    Likes Received:
    236
    Can anyone share some clues to redirecting an iframe after the submit button has been clicked?
     
  2. GreyWolf

    GreyWolf Executive VIP Jr. VIP

    Joined:
    Aug 17, 2009
    Messages:
    1,930
    Likes Received:
    5,387
    Gender:
    Male
    Occupation:
    Artist / Craftsman
    Location:
    sitting at my PC
    What kind of form are you using, fill in the blank or make a selection?
    Is the submit button inside the iframe?
    Or is the submit button somewhere else on the page and you want to change whats in the iframe when it's clicked?
     
    • Thanks Thanks x 1
  3. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    Put the code below in the <head>. My thread http://www.blackhatworld.com/blackhat-seo/black-hat-seo-tools/276584-tutorial-integrate-cpa-frames-regular-form.html also covers this code and more.
    Code:
    <script type="text/javascript">
    var oldHistory = history.length;
    setInterval("checkHistory()", 1250);
    
    function checkHistory() {
         if (oldHistory < history.length) {
              window.location.href = "[color=blue]http://www.yoursite.com/page2.html[/color]";
         }
    }
    </script>
     
    • Thanks Thanks x 4
  4. Kellan4ril

    Kellan4ril Newbie

    Joined:
    May 16, 2011
    Messages:
    3
    Likes Received:
    1
    thanks nice post i appreciate you guys
     
  5. sirgold

    sirgold Supreme Member

    Joined:
    Jun 25, 2010
    Messages:
    1,260
    Likes Received:
    645
    Occupation:
    Busy proving the Pareto principle right
    Location:
    A hot one
    You can also add an additional form (something like confirm your email) with the excellent code shared by artizhay and grab the email address of your lead for further use upon iframe submission. 1 stone, 2 birds... ;)