Jump to content

Archived

This topic is now archived and is closed to further replies.

pentan

inserting text into a textarea with a button ex surroundText?

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.