PDA

View Full Version : Generate text in a text field by clicking links, buttons, etc.



djr33
03-25-2006, 11:49 AM
I hope this isn't repeating an old question. Feel free to link me if so.

Basically what I want to do can be seen with the commands on the side and top of the posting window... you can click stuff and it automaticaly changes the content inside the text box.

What's the easy way to do that? Then feel free to expand a bit...

This is a general question, so there's no specific problem I'm trying to solve.

Thanks!

jscheuer1
03-25-2006, 02:45 PM
For javascript, this is one of the best solutions:

http://www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm

Good in IE and FF.

magicyte
07-28-2008, 09:04 PM
Well, Daniel, one way to do it is with JavaScript. Here is an example:


<input type="text" value="Wow" id="ws">
<br />
<input type="button" value="Click Me" onclick="document.getElementById('ws').value = 'yasa';">

I really do hope I helped you at all, you know, you being a moderator.

-magicyte

P.S. Were you a Junior Coder when you posted this???