Well, here's what I want to do, maybe you can tell me how to do it..
I want to have a list of items, that are clickable links, ie. apple, tomato, pear, carrot. Whenever you click on one of those links, it adds it to a nearby text field. Much like how the PHP block buttons work in this topic entry.
Thanks!!!!
Flashing a link to a text field - HOW!?
Moderator: General Moderators
the simplest way is probably something like this:
Just off the top of my head. There's plenty of ways to refine that to make it more extensible, but it should work.
Code: Select all
<script>
function addToText(product)
{
var text = document.GetElementbyId('textfield');
text.value = text.value + product;
}
<a href="garbage" onclick="addToText('carrot'); return false">carrot</a>
<textarea id="textfield" name="textfield"></textarea>