press link - textbox adds text

ok, so i want it so that when you press a link on the page, the text in a text box changes to some different text.....how can i do this please?<!--content-->Not exactly clear on what you want.<br />
<br />
Do you want the textbox to be part of a form and clicking different links will add different text to one of the textboxes in the form?<br />
<br />
OR<br />
<br />
Do you want something that looks like a textbox to display content in the middle of your page?<br />
<br />
OR<br />
<br />
None of the above and you mean something completely different?<br />
<br />
Kinda, sorta need answers to those questions before we can help. The URL of a site that has an example of what you're looking for would also be a good thing. :)<br />
<br />
Neil<!--content-->I think he ment the first one you said, that's what it looked like.<!--content-->ok:) i have 1 textbox, and about 14 links,<br />
when you press the link, it adds a different string to the same textbox<br />
if it cant be done with links, then command buttons would do<!--content-->Firstly give you textarea a name like this<br />
<textarea name="txtbox" cols="30" rows="10"></textarea><br />
Then put this script in your page head<br />
<script langauage="javascript"><br />
function display(txtmsg)<br />
{ document.all.txtbox.value=txtmsg }<br />
</script><br />
Finally for the link<br />
<a href=http://www.htmlforums.com/archive/index.php/"javascript:display('TEXT TO DISPLAY')">Click Here</a><br />
<br />
Here's an example<br />
<html><br />
<head><br />
<script langauage="javascript"><br />
function display(txtmsg)<br />
{ document.all.txtbox.value=txtmsg }<br />
</script><br />
</head><br />
<body><br />
<textarea name="txtbox" cols="30" rows="10"></textarea><br />
<a href=http://www.htmlforums.com/archive/index.php/"javascript:display('Link 1 was clicked!')">Link1</a><br />
<a href=http://www.htmlforums.com/archive/index.php/"javascript:display('Link 2 was clicked!')">Link2</a><br />
<a href=http://www.htmlforums.com/archive/index.php/"javascript:display('Link 3 was clicked!')">Link3</a><br />
<a href=http://www.htmlforums.com/archive/index.php/"javascript:display('Link 4 was clicked!')">Link4</a><br />
</body><br />
</html><br />
Remember to change java script to javascript - the forum splits it into two words.<!--content-->perfect thanks<!--content-->
 
Back
Top