Made things work.

Added missing </form> tag that was making report.php cry.
This commit is contained in:
aftercase 2021-08-21 21:57:53 +01:00
parent d6e37500fd
commit 56fa6a556a
2 changed files with 22 additions and 14 deletions

View file

@ -19,18 +19,29 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="theme/bulma/js/bulma-tagsinput.min.js"></script>
<script>
function setupTagsInput() {
BulmaTagsInput.attach();
function setupTagsInput() {
const tagsInput = document.getElementById('tags-with-source');
new BulmaTagsInput(tagsInput, {
source: async function (value) {
// Value equal input value
// We can then use it to request data from external API
return await fetch("/api/tags_autocomplete.php?tag=" + encodeURIComponent(value))
.then(function (response) {
return response.json();
});
}
allowDuplicates: false,
caseSensitive: false,
clearSelectionOnTyping: false,
closeDropdownOnItemSelect: true,
delimiter: ',',
freeInput: true,
highlightDuplicate: true,
highlightMatchesString: true,
itemText: 'name',
maxTags: 10,
maxChars: 40,
minChars: 1,
noResultsLabel: 'No results found',
placeholder: '10 Tags Maximum"',
removable: true,
searchMinChars: 1,
searchOn: 'text',
selectable: true,
tagClass: 'is-info',
trim: true,
});
}
@ -246,10 +257,6 @@
<label class="label">Tags</label>
<div class="control">
<input id="tags-with-source" name="tag_input" class="input"
data-max-tags="10"
data-max-chars="40" type="text" data-item-text="name"
data-item-value="name"
data-case-sensitive="false" placeholder="10 Tags Maximum"
value="<?php echo (isset($_POST['tag_input'])) ? pp_html_escape($_POST['tag_input']) : ''; // Pre-populate if we come here on an error" ?>">
</div>
</div>

View file

@ -142,6 +142,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
</div>
</div>
</div>
</form>
</article>
<div class="columns is-multiline">