skip to Main Content

Using jquery POST request to save form in django

here my form.html in this form I'm use Django model form. <div class="container"> <form action="{% url 'add_product' %}" id="product_form" method="POST" enctype="multipart/form-data"> {% csrf_token %} <div class="row"> <div class="col-sm-12"> <label for="">{{form.code.label}} :</label> {{form.code}} <span id="error">{{form.code.errors | striptags }}</span> </div> <div class="col-sm-12">…

VIEW QUESTION

Django Dropdown GET Option Data – Jquery

I wanted to get the selected text from the dropdown, But I am getting value if I use request.GET['Type']. I wanted to get Data001 instead of Value001 def index(request): print("The output: ",request.POST.get('Type')) return render(request,'index.html',content) <div class="form-row last"> <div class="form-wrapper"> <label…

VIEW QUESTION
Back To Top
Search