Reset the form before sending it back on success so that we clear the values.

This commit is contained in:
Bharat Mediratta
2009-01-18 23:25:42 +00:00
parent 9275742ef9
commit f0eb8cb641

View File

@@ -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",