xxxxxxxxxx
1
<div class="md-form">
2
<div class="chips chips-placeholder mb-0" id="ingredients"></div>
3
<small class="text-muted d-bloc mt-0">Massimo 15 ingredienti. Premi <strong>INVIO</strong> o <strong>, (virgola)</strong> dopo ogni ingrediente.</small>
4
</div>
1
1
xxxxxxxxxx
1
$('#ingredients').materialChip({
2
placeholder: '+ingrediente',
3
secondaryPlaceholder: 'Ingredienti',
4
data: [{tag: "tag 1"}, {tag: "ingrediente ;)"}]
5
});
6
/*
7
$(document).ready(function(){
8
var enterPressed = jQuery.Event("keydown");
9
var $chipsInput = $('#ingredients .input');
10
enterPressed.which = 13; // Enter keycode
11
$chipsInput.val('tekst1');
12
$chipsInput.trigger(enterPressed);
13
$chipsInput.val('tekst2');
14
$chipsInput.trigger(enterPressed);
15
})*/
Console errors: 0