mirror of
https://github.com/friendica/friendica
synced 2025-04-27 01:50:11 +00:00
Prevent tagsinput select element to be submitted without a value when they are required
- This was allowing to submit private messages to the wrong recipient
This commit is contained in:
parent
f6e4984d7e
commit
b24fe917e4
2 changed files with 4 additions and 7 deletions
|
@ -165,7 +165,7 @@
|
|||
|
||||
// add <option /> if item represents a value not present in one of the <select />'s options
|
||||
if (self.isSelect && !optionExists) {
|
||||
var $option = $('<option selected>' + htmlEncode(itemText) + '</option>');
|
||||
var $option = $('<option>' + htmlEncode(itemText) + '</option>');
|
||||
$option.data('item', item);
|
||||
$option.attr('value', itemValue);
|
||||
self.$element.append($option);
|
||||
|
@ -577,11 +577,6 @@
|
|||
tagsinput = new TagsInput(this, arg1);
|
||||
$(this).data('tagsinput', tagsinput);
|
||||
results.push(tagsinput);
|
||||
|
||||
if (this.tagName === 'SELECT') {
|
||||
$('option', $(this)).attr('selected', 'selected');
|
||||
}
|
||||
|
||||
// Init tags from $(this).val()
|
||||
$(this).val($(this).val());
|
||||
} else if (!arg1 && !arg2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue