[Fixed]-How to send data to view without using html forms?

1👍

✅

It is possible indeed.

Using javascript, catch the form submit event.

In the function, serialize the form (exemple using jquery : https://api.jquery.com/serialize/), or get the field values using selectors.

Craft your ajax request, then send it.

And on view side, don’t render a template, use jsonresponse instead : https://docs.djangoproject.com/en/1.9/ref/request-response/#jsonresponse-objects

Leave a comment