Answer the question
In order to leave comments, you need to log in
How to implement a tag input line on a website?
I want to tie the following tag input line to the site
thought to do through
from django import forms
class TagForm(forms.Form):
tag_input = forms.CharField(label='Input tags',
widget=forms.widgets.TextInput(attrs={'type': 'text',
'placeholder': 'Add tags here...'}),
)
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="{% static 'cms/style.css' %}">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<form action="#" method="post">
{% csrf_token %}
<div class="input-tags">
<span class="tags"></span>
{{ form.tag_input }}
<div class="dropdown">
</div>
</div>
<input type="submit" value="Send">
</form>
<script src="{% static 'cms/main.js' %}"></script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question