Hello I'm using tokenfield to create input tags.
I've tried to clone the element without success. Is there any way to do a proper cloning? This is for a dynamic form.
Problem : Fields doesn't work after the cloning. I think the issue is in to tokens.
This is my JavaScript code :
$('.tokenfield').tokenfield();
This is my cloning function :
$('.clone').on('click',function(){
var newLine = $(".attribute:first").clone();
$("#variants").append(newLine);
});
This is my HTML code :
<div id="variants">
<div class="row attribute">
<div class="col-lg-4">
<div class="input-group"> <span class="input-group-prepend">
<button class="btn btn-light clone" type="button"><i class="icon-plus3"></i></button>
</span> <input type="text" class="form-control" placeholder="Left button"> </div>
</div>
<div class="col-lg-8">
<div class="form-group mb-1"> <input type="text" class="form-control tags tokenfield" name="variant[value][]" value=""><br>
</div>
</div>
</div>
</div>