View Full Version : buttons which input text into text box


toolman
04-20-2004, 08:58 PM
Hello,
How do i create buttons which will add text to a text box or even better, by clicking on text or images, like the smilies on these boards.

Thanks

Mushroom5698
04-21-2004, 10:52 AM
Thau's Javascript tutorial is... like the best tutorial ever!

Sample Code:

<form name="form1"><input type="text" name="text">
<br>
<a onclick="window.document.form1.text.value='HELLO, EVERYONE!';">Click Here!</a>

And to make it add on to what the user typed....

<form name="form1"><input type="text" name="text">
<br>
<a onclick="window.document.form1.text.value=window.document.f orm1.text.value+'HELLO, EVERYONE!';">Click Here!</a>

toolman
04-21-2004, 07:36 PM
Thanks :D You know on some boards, like this one, when you type [b ] it makes the text bol etc, how is that done?

Mushroom5698
04-21-2004, 07:48 PM
You mean in html, right? it would be done like this...
<b>Since this text is bold, does that mean that it talkes boldly, or is it shy?</b>

Would be...

Since this text is bold, does that mean that it talkes boldly, or is it shy?

toolman
04-21-2004, 08:07 PM
Yeh like that, but how do i use tags with quare brackets without html tags?
say for example i wanted to change the colour of the text, instead of writing <font color =" blah blah etc, how could i do it with something like [red ] [b ] ?

Mushroom5698
04-21-2004, 08:39 PM
I could make a PHP script that lets you do that, if you want...