2👍
✅
It’s not trivial, but the basic steps you need are:
- Write some javascript to usurp the form submit button click
- Call your ajax function which sends data to “checking” view
- Write a “checking” view that will check if form data has changed
- If data have changed, submit the form
- If not, just stay on page
This blog post is a nice walkthrough of the entire process (though targeted towards a different end result, you’ll need to modify the view).
And here are some SO answers that will help with the steps above:
-
Basically:
$('#your-form-id').on('submit', function(event){ event.preventDefault(); your_ajax_function(); });
- Gotta do yourself!
- Submit form after checking
Source:stackexchange.com