Good day,
I am a new user to stack overflow and have an input field on which token field is loaded, when I enter tags manually it works fine, however when I try to input tags / options using another javascript function it doesn't add any tags. If I remove token field from the input field, the input field can receive a comma separated list of values fine. There seems to be a conflict with token field.
$('#submit_senderids').click(function() {
$('#senderids_input').val('New Tag');
}); //This click event should update the above input field value
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input class="form-control" type="text" placeholder="Sender id" id="senderids_input" data-tokens="" name="sender_ids">//Token triggered on this input field.
echo '<input class="checkbox_items" type="checkbox" name="selected_senderids" value="'.$row["sender_ids"].'"> ';
echo '<label class="col-4-md">'.$row["group_name"];
echo '</label>';
echo '  ';
echo '<label class="col-8-md">';
echo '['.$row['sender_ids'].']';
echo '</label>';
echo '<div>';
?>
</div>
<div class="modal-footer">
<button id="submit_senderids" type="button" class="btn btn-primary" data-dismiss="modal">Submit</button><!--THIS BUTTON IS USED CALL JQUERY FUNCTION THAT UPDATES THE SENDERIDS_INPUT text box-->-->
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
I was unable to find a similar issue on the internet. Please help to resolve this.