PDA

View Full Version : Forum-like Javascript



dedwards
03-04-2006, 01:16 PM
I found a javascript at this website: http://www.thecodebehind.com/code/javascript/examples/javascript-textarea-buttons-bold-italic.aspx.

I tried it out in my page but something is missing and it didn't seem to do the trick. I really don't know that much about javascript (being a webdesigner and not a programmer) but I do know that one ends the script with </script>.
Um... I'm not sure if I just input it wrong, but if anyone knows what's the matter or can come up with a better alternative, it will be greatly appreciated. :)

jscheuer1
03-04-2006, 01:53 PM
That script is written to insert bbCode proprietary forum editor tags into a textarea being used on a bbForum. It should output things that look like this (for bold text, for example):

text meant to be bold is here

However, this will not work on an ordinary HTML page as virtually anything entered into a textarea in plain HTML gets shown literally (without any parsing on the browser's or the server's part). Even if you were to edit the script to output this to the textarea (actual HTML tags):

<b>text meant to be bold is here</b>

In ordinary html, in a textarea, this would appear literally, just as it does above. There are text formatting scripts meant for ordinary HTML. Here (http://www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm) is one from DD. It doesn't work in all but does work in most browsers.