Page 1 of 1

Clicking on a link that adds text to the end of a text box

Posted: Wed Sep 17, 2003 8:07 pm
by like_duh44
My question is I have a link, and if clicked, I want it to place a certain string on the end of the content that is in a text box. Kind of like this, but this just replaces whats in the box, I want it to add it to the end.

Code: Select all

<?php

echo "<a href="#" onclick="document.message.post.value='  ';return false;">Click to add  to your post</a>";

echo "<form name="message">";

echo "<input type="text" name="message">";

?>
But the problem with this is that it replaces the text that is in the text box, how do I have it add it to the end of it?

Posted: Wed Sep 17, 2003 8:27 pm
by qads

Code: Select all

<?php
echo "<a href="#" onclick="document.message.post.value =  document.message.post.value + 
':)';return false;">Click to add  to your post</a>"; 
echo "<form name="message">";
echo "<input type="text" name="message">"; 
?>

Posted: Wed Sep 17, 2003 8:32 pm
by like_duh44
NVM, found out that this works:

document.message.post.value += ' :) '

EDIT: LOL, just missed your post. Thanks anyway

Posted: Wed Sep 17, 2003 8:34 pm
by like_duh44
Hey qads, what script did you make to change the 'image.jpg' on your site to change every second or whatever?