Title: Comments: Live Preview
Last modified: December 23, 2016

---

# Comments: Live Preview

 *  [Chris J. Davis](https://wordpress.org/support/users/chrisjdavis/)
 * (@chrisjdavis)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/comments-live-preview/)
 * I have ported the live preview hack from MT to WP.
    Basically this hack allows
   your users to see a live preview of what they are writing below the comment entry
   box. Currently it uses onkeyup, but you could easily change it to onblur if you
   don’t want the realtime updating. This is pretty easy all things considered, 
   and could pretty painlessly be implemented on the wp-admin/post.php page as a
   stop gap until the preview function is back. Here it is: Find it over on my blog,
   there was something screwy going on here, so I took down the code I had pasted
   here. You can find it at this link: [http://chrisjdavis.org/index/2004/03/15/live-preview-for-comments/463/](http://chrisjdavis.org/index/2004/03/15/live-preview-for-comments/463/)
   That is about it. I have this hack running on my site currently, so you can go
   on over there and see it in action. Just leave a comment! [http://chrisjdavis.org](http://chrisjdavis.org)

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/comments-live-preview/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/comments-live-preview/page/2/?output_format=md)

 *  [stevarino](https://wordpress.org/support/users/stevarino/)
 * (@stevarino)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40540)
 * Pretty cool. I never knew about the `innerHTML` method in javascript before…
 *  [TechGnome](https://wordpress.org/support/users/techgnome/)
 * (@techgnome)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40541)
 * Before everyone jumps all over this, I just tried it at Jesuit’s site, and it
   didn’t seem to work. Running FF 0.8 here. As I was reading this, I was wondering
   about if innerHTML was an IE thing….looks like it is…
    TG
 *  Thread Starter [Chris J. Davis](https://wordpress.org/support/users/chrisjdavis/)
 * (@chrisjdavis)
 * [22 years, 3 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40543)
 * No, its not. I wrote it using FF 0.8 as a test browser and I wrote a response
   to you (TechGnome) on my site using Safari and it worked just fine. Not sure 
   what your issue is.
    And I responded again using FF 0.8 for Panther and it was
   fine as well. Don’t know what to tell you. Anyone else who would like to try 
   this, go to this post: [http://chrisjdavis.org/index/2004/03/15/live-preview-for-comments/463/](http://chrisjdavis.org/index/2004/03/15/live-preview-for-comments/463/)
   and test it out, and then leave me a comment there or here to let me know if 
   there is something screwy going on. Thanks. Jesuit
 *  [chuckg](https://wordpress.org/support/users/chuckg/)
 * (@chuckg)
 * [22 years, 2 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40569)
 * Works great in Opera 7.22 — good work!
 *  [Sushubh](https://wordpress.org/support/users/sushubh/)
 * (@sushubh)
 * [22 years, 2 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40571)
 * oooh.. opera!!! i would have to try it now…
    does it validate?
 *  Thread Starter [Chris J. Davis](https://wordpress.org/support/users/chrisjdavis/)
 * (@chrisjdavis)
 * [22 years, 2 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40572)
 * It does now, I had forgotten that XHTML didn’t have the language attribute. If
   you are already running this just delete the language=”javascript” and it will
   validate.
    And thanks everyone for checking it out and letting me know if it 
   worked or not. Jesuit
 *  [TechGnome](https://wordpress.org/support/users/techgnome/)
 * (@techgnome)
 * [22 years, 2 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40574)
 * Honest! I swear! It wasn’t working, but now it is. The only thing I can think
   of was that I had the first comment…. ?????
    I sit corrected. Looks greast too!
   TG
 *  Thread Starter [Chris J. Davis](https://wordpress.org/support/users/chrisjdavis/)
 * (@chrisjdavis)
 * [22 years, 2 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-40575)
 * TechGnome: not a problem brother, I was starting to freak out before other people
   reported that they could use it!
    I just hope people can get some use out of 
   it. I certainly love it.
 *  [dariottolo](https://wordpress.org/support/users/dariottolo/)
 * (@dariottolo)
 * [22 years ago](https://wordpress.org/support/topic/comments-live-preview/#post-41263)
 * Hi Jesuit,
    I tried to use your plugin in WordPress 1.2, but could not make it
   work properly. I saved the file in the plugin directory, and activated it. But
   what should I change in wp-comments.php, in order to have the preview? Plus, 
   the wp-preview.phps available in [http://chrisjdavis.org/hacks/wp-preview.phps](http://chrisjdavis.org/hacks/wp-preview.phps)
   does not end in `?>`. Is it ok anyway? Any help would be greatly appreciated.
 *  [tontamoo](https://wordpress.org/support/users/tontamoo/)
 * (@tontamoo)
 * [22 years ago](https://wordpress.org/support/topic/comments-live-preview/#post-41264)
 * Are there any plans to update hack for WP 1.2?
 *  [seriocomic](https://wordpress.org/support/users/seriocomic/)
 * (@seriocomic)
 * [22 years ago](https://wordpress.org/support/topic/comments-live-preview/#post-41272)
 * I found that this version .65 RC1 doesn’t work as a plugin for 1.2, but does 
   work if you cut and paste the functions into your my-hacks file and call the 
   functions as instructed.
    I look forward to this being developed as a plugin,
   but because it doesn’t rely on any hook or action I dunno how it will.
 *  [khaled](https://wordpress.org/support/users/khaled/)
 * (@khaled)
 * [21 years, 12 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-41286)
 * Sorry seriocomic could you elaborate a bit on your post. I’m trying to get this
   to work but I think my serious lack of php skills at the moment might be the 
   cause, does this hack work with 1.2 or not? Is my-hacks another plugin that you
   can put all the functions into and then call them from there?
    Also is it possible
   to elaborate on one thing specifically that has eluded me completely. I don’t
   understand where I should be putting the onkeyup function. The documentation 
   says that it should be included in the two following files, but a) I’m not sure
   which ones b) more importantly I don’t know where and how. Any elaboration would
   be brilliant.
 *  Anonymous
 * [21 years, 11 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-41295)
 * It’s not working for me. What am I doing wrong? I activated the plugin. Then 
   I made these 3 changes to the wp-comments.php file (with their following lines
   included for reference):
    1. ` <?php commentScript() ?> <form action="<?php echo
   get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"
   >  2.  <h2 id="comments" onkeyup="ReloadTextDiv();" ><?php comments_number(__("
   Comments"), __("1 Comment"), __("% Comments")); ?>  <?php if ('open' == $post-
   >comment_status) { ?>  3.  <?php comments_Div() ?> <?php } else { // comments
   are closed ?>
 *  [pezastic](https://wordpress.org/support/users/pezastic/)
 * (@pezastic)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-41296)
 * Great! I got it working. I changed number 2 to:
    ` <textarea name="comment" id
   ="comment" onkeyup="ReloadTextDiv();" cols="35" rows="4" tabindex="4"></textarea
   >
 *  Thanks for the help.
 *  [davidprince](https://wordpress.org/support/users/davidprince/)
 * (@davidprince)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/comments-live-preview/#post-41303)
 * I am having huge problems with this. Everything seems to work (ie the previewing)
   until I try to submit a comment or even login to wp-login.php. Then I get a whole
   bunch of Warning: Cannot modify header information – headers already sent by (
   output started at …./liveupdate.php:43) in ……
    I really have no idea what is 
   going but I have disabled the plugin by changing its name back to .phps and everything
   is back to normal.. Except I really like this plugin and want to use it. Any 
   suggestions?

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/comments-live-preview/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/comments-live-preview/page/2/?output_format=md)

The topic ‘Comments: Live Preview’ is closed to new replies.

## Tags

 * [preview](https://wordpress.org/support/topic-tag/preview/)

 * 25 replies
 * 16 participants
 * Last reply from: [renjer](https://wordpress.org/support/users/renjer/)
 * Last activity: [20 years, 7 months ago](https://wordpress.org/support/topic/comments-live-preview/page/2/#post-41353)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
