Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Form Question

  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Question

    Hi,

    I'm so new I can't even spell newbee. Hopefully someone can help. I have a form setup on a demonstration page here...

    http://cbsqueezevideos.com/form.html

    What I want to do is have visitors enter their Clickbank ID in the third box where is says "Enter Your Clickbank Id:" after they have entered their name and email address in the form.

    When the visitor clicks the "Get Affiliate Link" button, the input of the Clickbank ID box will replace the "xxxxx" in the three text fields below the main form. So if a visitor enters "horse" into the Clickbank ID field, upon clicking the button, all the text boxes which now read http://xxxxxx.malacka2.hop.clickbank.net would automatically read http://horse.malacka2.hop.clickbank.net.

    The form submission button works fine and posts to my autoresponder as it should. However, I'd like to add the above functionality as well.

    If that's not possible...

    Is there a way to simply make a separate input and button that will do the same thing as described above without having to be attached to name and email function. That would work for me too.

    What I'm trying to do is give visitors an easy mechanism so that once they enter their ID into one form and press the button, their identification is populated into several places on the same page.

    Sorry to be so long winded but I wanted to try to clearly explain what I'm trying to get accomplished.

    Any help would be GREATLY appreciated.

    Thanks,

    Malacka

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    changing doStuff to
    Code:
    
    function updateCBID() {
     var cbId = document.getElementById('fCBID').value;
     document.getElementById('Description').value = '<a href="http://' + cbId + '.malacka2.hop.clickbank.net">Free professional video infomercials to promote Clickbank products!</a>';
     document.getElementById('textarea').value = '<a href="http://' + cbId + '.malacka2.hop.clickbank.net">Free professional video infomercials to promote Clickbank products!</a>';
     document.getElementById('textfield4').value = 'http://' + cbId + '.malacka2.hop.clickbank.net';
    }
    
    function dostuff()
    {
     updateCBID();
     document.getElementById('redirect').value = "http://www.cbsqueezevideos.com/affiliate/?CBID=" + document.getElementById('fCBID').value;
    
     
    
     document.getElementById('from').value = document.getElementById('femail').value;
     document.getElementById('name').value = document.getElementById('fname').value;
     document.getElementById('submitform').click();
    }
    provided u don't forget giving ids to the following
    Code:
    <input name="textfield4" id="textfield4" size="45" value="http://xxxxxx.malacka2.hop.clickbank.net" type="text">
    textarea id="Description" name="Description" cols="60" rows="4"></textarea>
    <textarea name="textarea" id="textarea" cols="60" rows="4"></textarea>
    another way to do this would be to use the onblur event on the fCBID which

    Code:
    <input name="fCBID" id="fCBID" type="text" onblur="updateCBID()">
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow


  •  

    Posting Permissions

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