Skip to content
Snippets Groups Projects
Commit 096ccf81 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Elmar Ludwig
Browse files

set value before submitting, fixes #2784

Closes #2784

Merge request studip/studip!1882
parent 559ab723
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,9 @@ class Course_DatesController extends AuthenticatedController
} else {
PageLayout::postInfo(_('Thema war schon mit dem Termin verknüpft.'));
}
$this->redirect($this->indexURL());
return;
}
Navigation::activateItem('/course/schedule/dates');
......
<?php
/**
* @var Course $course
* @var CourseDate $date
*/
?>
<form action="<?= URLHelper::getLink("dispatch.php/course/dates") ?>" method="post" id="dates_add_topic" class="default">
<input type="hidden" name="termin_id" value="<?= $date->getId() ?>">
<fieldset>
......@@ -16,8 +22,9 @@
jQuery(function () {
jQuery("#dates_add_topic .topic_title").autocomplete({
'source': <?= json_encode($course->topics->pluck('title')) ?>,
'select': function () {
jQuery("form#dates_add_topic").submit();
'select': function (event, { item }) {
$(this).val(item.value);
jQuery("#dates_add_topic").trigger('submit');
}
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment