diff --git a/mod/data/edit.php b/mod/data/edit.php
index df09006d958..132f600438c 100644
--- a/mod/data/edit.php
+++ b/mod/data/edit.php
@@ -268,6 +268,9 @@ if ($datarecord = data_submitted() and confirm_sesskey()) {
'rid' => $recordid,
));
redirect($viewurl);
+ } else if (!empty($datarecord->saveandadd)) {
+ // User has clicked "Save and add another". Reset all of the fields.
+ $datarecord = null;
}
}
}
@@ -354,7 +357,7 @@ if ($rid) {
echo ' ';
} else {
if ((!$data->maxentries) || has_capability('mod/data:manageentries', $context) || (data_numentries($data) < ($data->maxentries - 1))) {
- echo ' ';
+ echo ' ';
}
}
echo '';