Jump to content

inserting text into a textarea with a button ex surroundText?


pentan

Recommended Posts

Ok... simplest way to say it is I want to be able to do like you can when you responsd to a thread here:  You have buttons that had in the markers in the text area for things like hitting the "B" button puts in here [b][/b].  I've tried to figure it out from looking at the code on this very page and searching for it, but I can't seem to get it to work.  Anyone know of a tutorial?
Link to comment
Share on other sites

I don't know of a tutorial to do it, but if you'd like a hint, I'd probably use javascript to insert an extra bit of text. Not sure exactly how though. It could be done by using the b button as a form submit button which takes the text of the area and adds the required code to the box. You'd then need to interpret the code at runtime by finding the text between the two tags and changing it, then deleting the tags. I think this is called XML, but it's a fancy way of saying "make up your own tags".

Hope this helps in some way.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.