View Full Version : Form Question

10-01-2007, 09:07 AM

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


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.



10-01-2007, 01:26 PM
changing doStuff to

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()
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;

provided u don't forget giving ids to the following

<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

<input name="fCBID" id="fCBID" type="text" onblur="updateCBID()">