mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-28 16:39:20 -04:00
Reset the form before sending it back on success so that we clear the values.
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user