STEPS
1. You will add a name attribute to all your input fields.
2. Add the crsf_token django template in-built filter to support 'POST'
3. Change your form's method to 'POST'
4. Add an action attribute and set it to your view
5. Then the JQUERY part will be as follows
6. Don't forget to give your form ad ID
Then
$("#form_id").submit(function(e){
e.preventDefault() //prevent the default submit behaviour of a form
let data = $(this).serialize() // this picks all data basing on the name attribute including the csrf_token
//now perform the request
$.ajax({
url:url,
data:data,
type: "POST",
dataType: "json", // or the data type you expect from your response
beforeSend: function(){
// optional-> whatever you want to access before executing the request
// eg showing some loader
},
success: function(response){
// whatever you want to do on successful request
},
complete: () =>{
//whatever you want to do when the request is complete
// stopping some loader
}
})
})