Live comment preview update

| techie stuff | | Comments (5) | TrackBacks (5)

Samuel made a change to the live comment preview code and I've installed it here. I'm going to document the change here in case I ever have to install it again.

Thanks for the fix, Samuel!

New and improved ReloadTextDiv code:

function ReloadTextDiv()
{
var NewText = document.getElementById("DynamicText").value;
splitText = NewText.split(/\n/);
var DivElement = document.getElementById("TextDisplay");
var i = 0;
DivElement.innerHTML = '';
for(i = 0; i < splitText.length; i++) {
if(splitText[i].length > 0 ) {
DivElement.innerHTML += splitText[i] + "<br />";
}
}
}

5 Comments

Samuel said:

I updated the code so it wraps each paragraph in paragraph tags instead of brackets. I was using the brackets to debug.

Oopsie...

Samuel said:

You should take out the if statement inside that for loop, otherwise if you put in blank lines.

like that, it will trim them out.

Samuel said:

It looks like MT trims them out any way. NeverMind (blame that one on Brad, it was his idea tongue)

kristine said:

ahhh, so is it cooler?

YOU are cool, that's for sure

Lisa said:

I like it because it's a more accurate representation of the comment you're leaving. smile

I think you're really cool too!

5 TrackBacks

Listed below are links to blogs that reference this entry: Live comment preview update.

TrackBack URL for this entry: http://www.beantowngeek.com/cgi-bin/mt/mt-pong.cgi/202

» Update to Live Comment Code from Alieniloquent

This update was significant enough that I decided to actually make it a post of its own.... Go back and... Read More

» live comment preview from Al-Muhajabah's Movable Type Tips

Live comment preview allows commentors to see what their comment will look like as they type it. It's a neat trick, although it works best if you have your comment posting form on the individual entry archive page or otherwise... Read More

» From b2 to MT from Ecthelion

Converting journal from b2 to MT. Read More

» From b2 to MT from Rover

I'm finally converting my journal from b2 to movabletype. Here's why and a list of articles/plugins/tricks I implemented in my new MT journal... Read More

» live comment preview from Al-Muhajabah's Movable Type Tips

Live comment preview allows commentors to see what their comment will look like as they type it. It's a neat trick, although it works best if you have your comment posting form on the individual entry archive page or otherwise... Read More

About this Entry

This page contains a single entry by Lisa published on June 8, 2003 10:08 AM.

What kind of blogger am I? was the previous entry in this blog.

Congratulations! is the next entry in this blog.

Find recent content on the main index.

Me!

A true friend is someone who reaches for your hand and touches your heart.

About me... :: memes :: My Amazon wishlist :: My LJ :: My Twitter :: My Flickr :: Photos of me

Blog reading list

Contacts
· AIM, Yahoo!, MSN, Google Talk, LJ Talk... just ask
· Email me

Good Causes

       
Love is love.
Support gay marriage.

platinum.gif
East siiiiiiiiiiiiiiiiiiiide, baby!
Click to help
sponsor mammograms
Listen to good music! Radio Paradise

Silly Stuff

blogchalk:
Lisa/Female/41-45. Lives in United States/Mass/Boston and speaks
English. Spends 80% of daytime online. Uses a Faster (1M+) connection.
The
WeatherPixie
The weather in Boston

Flickr

www.flickr.com
jasra's photos More of jasra's photos
Powered by Movable Type 4.1

Copyright

Copyright © 2001-7 Lisa K Holsberg. Unauthorized use is prohibited.