Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-01-2007, 08:07 AM   PM User | #1
malacka
New to the CF scene

 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
malacka is an unknown quantity at this point
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
malacka is offline   Reply With Quote
Old 10-01-2007, 12:26 PM   PM User | #2
shyam
Senior Coder

 
shyam's Avatar
 
Join Date: Jul 2005
Posts: 1,563
Thanks: 2
Thanked 163 Times in 160 Posts
shyam will become famous soon enough
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
shyam is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:04 AM.


Advertisement
Log in to turn off these ads.