Advertisement Jump to content
Sign in to follow this  

[web] Inserting objects into textarea's

This topic is 4909 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've searched around for a couple of hours, and I can't find what I need, or it is way too complex. How can I insert a specific tag at the cursors position by clicking a button?
<script language="JavaScript" type="text/JavaScript">
function sendText(e, text)
{e.value=e.value + text;}
<img name="image" width="300" height="200" onClick="sendText(document.form1.taupdate, '<font color=red>')">
<form name="form1" method="post" action="">
<textarea name="taupdate" cols="30" id="taupdate"></textarea>

This adds text to the end of it, but how can I add text to wherever the cursor is?

Share this post

Link to post
Share on other sites
I have personally never seen it done. Looks like your users are just going to have to cut and paste the tags to get them where they want them.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
You can actually insert text where the cursor is. Visit

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!