diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-18 23:25:42 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-18 23:25:42 +0000 |
commit | f0eb8cb6416c7eb1586dbaa671569d7ca3355958 (patch) | |
tree | 6f8883071364c9c1b0934d1850c6e062d3df0710 /modules | |
parent | 9275742ef96cb2a0a6f9ec9240aaf4567a236b03 (diff) |
Reset the form before sending it back on success so that we clear the values.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment/controllers/comments.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index 1b936671..d04ba60c 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -80,11 +80,16 @@ class Comments_Controller extends REST_Controller { $form->add_comment->email->value, $form->add_comment->url->value); + $form->add_comment->inputs["name"]->value(""); + $form->add_comment->text->value(""); + $form->add_comment->email->value(""); + $form->add_comment->url->value(""); print json_encode( array("result" => "success", - "resource" => $comment->state == "published" ? url::site("comments/{$comment->id}") : - NULL, - "form" => comment::get_add_form($item)->__toString())); + "resource" => ($comment->state == "published" + ? url::site("comments/{$comment->id}") + : null), + "form" => $form->__toString())); } else { print json_encode( array("result" => "error", |