Javascript: form text to bold onclick
hi,
I am currently making a site for a Belgian company and they want to be able to edit the content of their site through some kind of administration panel. I have created such a secured panel using PHP but I am having some problems to make a user friendly system for them to alter the site.
I have a form that that is filled out with the current text when they open it. The idea is that they can alter the text AND the layout of that text and there is my problem.
I would like them to be able to select text in a textarea field and when they click on the BOLD button the selected text should be bold immediately.
In the beta version of the system I'm using some phpBB-like system that adds (b) and (/b) around the selection but I would consider it more user friendly if I could lose the tags and let the selected form text go bold.
I have tried doing this with
document.selection.createRange().text.style.fontWe ight="bold" but that did not work
any ideas?
grtz
DragonEye
|