How to insert a variable ANYWHERE in a TEXTAREA of a form?

He has: 12 posts

Joined: Mar 2005

Hi guys,

Here's a challange for you, as it's most cerainly
for me:

I want to allow an affiliate to enter his/her
affiliate number in a small form field.

When they press "Submit" this number will
automatically be inserted in a "textarea" of a form.

Here's an example:
--------------------

Click here to find out more...

-=-=-=-=-=-=-=-=-=-=-=-=

Now how would I get that "XXXXX" to be substituted
by the affiliate number or just any variable that
was entered and submitted??

Tough one hey! Smiling

Thank you soooo much for your help. Also please
give me an example of the code of how I would do it.

Andre Vas

Are YOU Using This Amazing Forum Software Yet?...
** Click here to find out: (You'll be suprised!)

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

<script language="javascript">
function create_link()
{
var output = '';
var input = '';
input = formname.afID.value;
output = '<A HREF="http://assoc.speedsuccess.com/go/t.php?a_aid='+input+'>Click here to find out more...</A>';
formname.textareaname.value = output;
}
&lt;/script&gt;


<a onclick="create_link();" href="#">Click</a><br>
<form name="formname">
<input name="afID" type="text" value="99999"><br>
<textarea name="textareaname" cols="75" rows="2" wrap="virtual">
<A HREF="http://assoc.speedsuccess.com/go/t.php?a_aid=XXXXX">Click here to find out more...</A>
</textarea>
</form>
'

They have: 5,633 posts

Joined: Jan 1970

&lt;script&gt;
function change_link(){
document.getElementById('image1').value = '<A HREF ="http://assoc.speedsuccess.com/go/t.php?a_aid=' + form.aff_num.value + '">Click here to find out more...</A>'}
&lt;/script&gt;
'

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.