Title: ajax comment post   validation   return json
Last modified: August 20, 2016

---

# ajax comment post validation return json

 *  [gurde](https://wordpress.org/support/users/gurde/)
 * (@gurde)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/)
 * I’m sending the comment form with ajax to it’s default action domain/wp-comments-
   post.php and it returns a 500 error page.
 * What I want is to validate the form and return a json with invalid inputs => 
   error message association json. If form input is valid try to add comment, if
   not added return error json, if added return comment => rendered li element association
   json.
 * The question is NOT javascript related, is wordpress related.
 * Don’t know how else to explain it better.
    Thanx for your time.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [gurde](https://wordpress.org/support/users/gurde/)
 * (@gurde)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174132)
 * Is there no solution for my problem?
 *  [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * (@kmessinger)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174176)
 * Does this apply?
    WordPress 3.2 required PHP 5.2.4 or later, class-json.php was
   included for compatibility with older versions of PHP only. It was removed here:
   [http://core.trac.wordpress.org/changeset/17603](http://core.trac.wordpress.org/changeset/17603)
 * Unfortunately, Your theme will need to be updated, you may find that simply commenting
   out the include line will allow it to continue working if it was using the PHP
   json functions like any well built theme would have been.
 * Alternatively, Copy the json file into your themes folder, and modify the include
   line to reference the themes folder instead of WordPress’s.
 * [http://wordpress.org/support/topic/troubleshooting-wordpress-32-master-list?replies=7](http://wordpress.org/support/topic/troubleshooting-wordpress-32-master-list?replies=7)
 *  Thread Starter [gurde](https://wordpress.org/support/users/gurde/)
 * (@gurde)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174243)
 * I have wordpress 3.2, all system requirements fulfilled. The theme was made by
   me (no plugins used), from scratch. The question is still the same. How can I
   do the above?
 * [@kmessinger](https://wordpress.org/support/users/kmessinger/) you answer didn’t
   help. My problem didn’t work before since was not implemented, I want to implement
   it now. And what line commenting are you talking about? What json file? I don’t
   know what are you talking about.
 *  [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * (@kmessinger)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174244)
 * > [@kmessinger](https://wordpress.org/support/users/kmessinger/) you answer didn’t
   > help.
 *  Ahh yes, well you get what you pay for. :^)
 * Does the server support json?
 * Run this,
 *     ```
       <?php
        phpinfo();
       ?>
       ```
   
 *  Thread Starter [gurde](https://wordpress.org/support/users/gurde/)
 * (@gurde)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174246)
 * Why are you talking rubbish? Of course it does.
    Did you read my question?
 * I’ll rephrase it: send comment form with ajax, validate the form return error
   as json or on success return the comment (actual LI element with whatever else
   it contains) in the json so I can updated the comments list (OL). How do I do
   that?
 * In this freakin’ codex there is no example on how to use ajax with your wordpress.
   Or I must be blind.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174247)
 * It might be better if you diverted some of your energy away from abusing volunteers
   who are trying to help you and into doing some of your own searching: [http://codex.wordpress.org/Function_Reference/wp_enqueue_script](http://codex.wordpress.org/Function_Reference/wp_enqueue_script)
 *  Thread Starter [gurde](https://wordpress.org/support/users/gurde/)
 * (@gurde)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174253)
 * I start to think that most here on forums don’t understand English or don’t know
   how to read.
 * [@esmi](https://wordpress.org/support/users/esmi/): who did I abuse and with 
   what? Please read my question again.
 * And again: after submitting my comment using ajax how do I return the results
   as json? How do I handle ajax request? There is not a single line about this 
   in the codex!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘ajax comment post validation return json’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [json](https://wordpress.org/support/topic-tag/json/)
 * [validate](https://wordpress.org/support/topic-tag/validate/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [gurde](https://wordpress.org/support/users/gurde/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/ajax-comment-post-validation-return-json/#post-2174253)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
