I have a unique challenge where I am using dropzone js to create a form for users to upload information and images. Dropzone js requires a form with a class of dropzone for drag and drop image uploads to function properly, resulting in two forms: the regular input form and the dropzone js form. Is there a way to submit both forms with just one submit button? It's important to note that I am working with HTML forms, not django crispy forms.
<form method="POST" enctype="multipart/form-data" id="inputform" name="form1">
{% csrf_token %}
<button type="submit" id="add">Save</button>
</form>
<div class="col-sm-12 col-lg-6" id="inner">
<form method="POST" enctype="multipart/form-data" id="inputform" name="form1">
{% csrf_token %}
<h4>Title</h4>
<input type="text" name="product_title" id="product_title" placeholder="Give your product a name">
<h4>Price</h4>
<input type="text" name="product_price" id="product_price" placeholder="0.00">
<h4>Description</h4>
<input type="text" name="product_description" id="product_description" placeholder="Write a description about your product">
</form>
</div>
<div class="col-sm-12 col-lg-6" id="inner2">
<h3>Images</h3>
<form method="POST" action="#" class="dropzone col-sm-8 col-lg-8" id="dropzone" name="form2">
{% csrf_token %}
</form>
</div>
def add(request):
if request.method == "POST":
title = request.POST.get("product_title")
price = request.POST.get("product_price")
description = request.POST.get("product_description")
print(title,price,description)
return render(request,"main/add.html")