Staredit Network > Forums > Technology & Computers > Topic: How to insert text (JAVA/PHP/HTML)
How to insert text (JAVA/PHP/HTML)
Jul 7 2009, 7:39 pm
By: Devourer  

Jul 7 2009, 7:39 pm Devourer Post #1

Hello

Hey all,
what I want to know is how to "add a new word" into a textarea after clicking on an icon, similar to this on SEN while you are posting a reply, you click on a smilie and codes like :hurr : will appear at the text end?
I'm pretty sure it's done with javascript. Please reply with an example-code + explanation.

EDIT: The same with the color like on SEN here, like at the beginning and at the end of a selected text-part?

Thanks in advance.

Post has been edited 1 time(s), last time on Jul 7 2009, 8:44 pm by DeVouReR.



Please report errors in the Staredit.Network forum.

Jul 7 2009, 8:43 pm DT_Battlekruser Post #2



It's done using JavaScript, which is actually completely different from Java.

I'm a little too lazy to give an in-depth tutorial, but basically you add an onClick action (<img ... onClick="addSmileyText(':hurr:')"> or something) and then you find the component you want to edit on the page and do .value += text.

Here's a tutorial on pretty much the same thing: http://www.mediacollege.com/internet/javascript/form/add-text.html




None.

Jul 7 2009, 8:49 pm Devourer Post #3

Hello

Thanks, on the first view it looks promising, also I knew it was java-script (I don't even know the language java [never took a look at it])



Please report errors in the Staredit.Network forum.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:58 pm]
NudeRaider -- NudeRaider
NudeRaider shouted: Oh_Man nothing too special tbh. the human player wasn't ready to combat the push that stretched almost the whole map. So this game means nothing. We'll have to see how it goes once the humans have adjusted for its unorthodox strategies.
they basically lost most of their army in one big battle and didn't have the time and production to leverage the economic advantage and come back from that blow.
[01:55 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: https://youtu.be/1vsTqNwHquE omg guys it's happening. ITS HAPPENING. EVERONY STAY CALM. STAY F:wob::wob:CKING CALM!
not sure why you are so hyped, when basically the same happened 7 years ago with AlphaStar on SC2.
[01:53 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: 6000 apm XD, i dont even understand how it culd came back wen it was 5 base vs 2
nothing too special tbh. the human player wasn't ready to combat the push that stretched almost the whole map. So this game means nothing. We'll have to see how it goes once the humans have adjusted for its unorthodox strategies.
[10:59 am]
NimoStar -- "Sick" is the appropriate word for the disease that AI is foisting upon our society. Repent, ye sinners!
[06:32 am]
Ultraviolet -- that was pretty sick lol
[02:55 am]
Oh_Man -- 6000 apm XD, i dont even understand how it culd came back wen it was 5 base vs 2
[02:42 am]
Symmetry -- 'twas only a matter of time
[02:40 am]
Oh_Man -- https://youtu.be/1vsTqNwHquE omg guys it's happening. ITS HAPPENING. EVERONY STAY CALM. STAY F:wob::wob:CKING CALM!
[02:20 am]
Symmetry -- :wob:
[2026-9-18. : 10:51 am]
Oh_Man -- :wob:
Please log in to shout.


Members Online: Dem0n