Ok, taking Sue’s problems with the block codes into consideration, I changed the live preview around. Here’s what the script should look like now:
function ReloadTextDiv()
{
var NewText = document.getElementById(“DynamicText”).value;
NewText = NewText.replace(/n/g, ‘<br />’);
NewText = NewText.replace(//gi,’<b>’);
NewText = NewText.replace(//gi,’</b>’);
NewText = NewText.replace(//gi,’<i>’);
NewText = NewText.replace(//gi,’</i>’);
var DivElement = document.getElementById(“TextDisplay”);
DivElement.innerHTML = NewText;
}
This will show in the preview carriage returns, bold and italics using blockquotes. I’m working on the regex for URL’s, I can’t seem to get it working right. I keep getting a javascript error. If anyone has a script that will work, let me know!
How does this post make you feel?
- Excited
- Fascinated
- Amused
- Bored
- Sad
- Angry
Looks better! Doesn’t support [ color=red ] though. :)
But [ b ] worked!
LOL I didn’t know you could change colours. well damn, i’ll put that in (or try to). I had enough problems with the url thing..ugh!