i have problem. why my form doesn't show except i clicked submit button. is that any problem with my code?
here's my html code :
<form method="POST" enctype="multipart/form-data">
<button type="submit" class="dsnupload">
<i class="large material-icons" style="font-size: 50pt; margin-top: 10px;">audiotrack</i>
<p style="font-weight: bold; color: white;">Insert file audio (mp3)</p>
{% csrf_token %}
{{form}}
</button>
</form>
form.py :
from django import forms
class Audio_store(forms.Form):
record=forms.FileField(widget=forms.FileInput(attrs={'style': 'width: 300px;', 'class': 'form-control'}))
views.py :
def homepage(request):
if request.method == "POST":
form = Audio_store(request.POST, request.FILES)
if form.is_valid():
handle_uploaded_file(request.FILES['record'])
return render(request, "homepage.html", {'form': form})
else:
return render(request, "homepage.html")
at the second orange button on the left (insert file audio) there's text :
record :
- this field is required.
i want to remove that text, please help me.