Tag manager jquery tag tag

Asked

Viewed 57 times

0

since a while ago, my tag manager, in Yii framework, is generating tags with a "tag separator?" instead of a comma, which can be?

Code:

$('.tm-input').tagsManager({
    prefilled: ["<?php echo $model->tags ?>"],
    tagsContainer: '.tags-show',
    CapitalizeFirstLetter: true,
    preventSubmitOnEnter: true,
    typeahead: true,
    delimeters: [680, 188, 13],
    backspace: [8],
    blinkBGColor_1: '#CDE69C',
    blinkBGColor_2: '#CDE69C',
    hiddenTagListName: 'hiddenTagListA',
    hiddenTagListId: "Node_tags"

});

jQuery(".tm-input").on('tm:refresh', function (e, taglist) {
    $("#Node_tags").val(taglist); //isto faz com que ele pegue no node_tags e insira as tags do html dentro do taglist do php
});

Form:

 <div class="row">
        <div class="col-lg-12">
            <?php echo $form->labelEx($model, 'tags'); ?>

            <!--- Criei este input em html para este ser preencido enquanto o que está em php vai receber os valores deste -->
            <input type="text" value="<?php echo $model->tags ?>" id="taggenerator" class="tm-input form-control" placeholder="Insira tags aqui..."/>
            <?php echo $form->error($model, 'tags'); ?>



            <div class="col-lg-12 tags-show">
                <!---Este é o hidden field que vai receber e enviar para a db os valores do input-->
                <?php echo $form->hiddenField($model, 'tags'); ?>
            </div>
        </div>
    </div>

EDIT: When I do the tags, the result is this: inserir a descrição da imagem aqui

  • Where do the "?" appear? You can give an example?

  • I edited the question with the answer to your question! Thanks ! :)

  • Have you looked at the source code to see what appears in prefilled: ["<?php echo $model->tags ?>"],?

  • I saw yes, the tags appear separated by the question mark, because that is what is inserted, the prefilled simply serves to fill automatically if an update is made. But I found that the error is in the delimiters, putting the original values: delimiters: [9, 13, 44], the comma reappears.

  • But the problem is that co-locating values like this, my tag, when I update it, not all tags appear, but only the first tag...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.