The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hi, I am building a web based site administration tool and I would like to implement a system whereby when a site administrator is adding a news item or whatever they can click on a text or button link (say, "Bold") and it will automatically insert the correct tags (i.e. "<b></b>"). Almost exactly like vBulletins code imput buttons when you are composing a new topic or reply. But with vBulletins version you are presented with a textbox you need to type in which then puts the code and your text in the form, I want my version to just put the code in. I can't really explain it but I hope you get it. I don't think this should be too long of a script, one or two functions at most but I really have no idea how to write it, can any SitePointers help me?

yes, but keep in mind that if you let people insert html into your textbox, without doing an htmlEncode() or something like that before you send it to the database, they can insert malicious code(redirects, popups, images etc...) that will fire each time you go to render the info. conversly, if you implement sometype of htmlEncode() function than the following concept won't work.