1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[JS]CPA Lead + Download Box Question!

Discussion in 'JavaScript' started by sarsh11, Nov 29, 2009.

  1. #1
    Ok let me explain what I want to do first, I have a "Download HQ" link which is something like this:

    As you can see I have managed to add the CPA Lead gateway code into the link such that when someone clicks on download it'll pop-up the gateway. Now the problem is that when someone clicks on it the gateway opens, but the download dialog box[Open, Save as etc.] opens up above the gateway therefore making the gateway useless. I want to know if there is anyway I can make the download dialog box open only if the user completes the survey, and if he doesnt the box should not open.
    Check the second site in my signature for the working link.
    Any help is appreciated.
     
    sarsh11, Nov 29, 2009 IP
  2. 1one

    1one Active Member

    Messages:
    115
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    70
    #2
    <SCRIPT language="JavaScript1.2">
    var clicks = 0;
    function downclick(uriloc)
    {
    if (clicks == 0){
    startGateway('YOUR_GATEWAY');
    clicks = clicks + 1;
    } else {
    testwindow= window.open(uriloc, "mywindow1","location=1,status=1,scrollbars=1,width=100,height=100");
    testwindow.moveTo(0,0);
    return false;
    }
    }
    </SCRIPT>


    <a href="#" onclick="javascript:downclick('URL_TO_FILE')">Download HQ</a>


    First Click opens CPALEAD gateway, second click opens file download. Second click can be maded after survey was completed.


     
    1one, Nov 29, 2009 IP
    sarsh11 likes this.
  3. sarsh11

    sarsh11 Active Member

    Messages:
    959
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    70
    #3
    Thats a great idea man! Thanks! +Rep added!
    I don't want to sound like an ass but can anyone test if the download box comes up after finishing the survey? I can't check because there are no surveys available for my country..anyone?
    Thanks :)
     
    sarsh11, Nov 29, 2009 IP
  4. lukey372

    lukey372 Notable Member

    Messages:
    2,693
    Likes Received:
    73
    Best Answers:
    0
    Trophy Points:
    250
    #4
    Hey I can't actually get this too work :\
     
    lukey372, Dec 6, 2010 IP