I have a Django ModelForm but don’t want the user to click on a reguar submit button.
Instead, I made my own submit button and will post the form data using Ajax/jQuery.
The data to post is a mix of the form data plus other information I gather on my UI.
But… how do i get the formatted POST data the html form was supposed to submit?
If I can get it like JSON or jQuery object, better!
I have a Django ModelForm but don’t want the user to click on a
Share
You can use
jQuery.serialize()for this which you in turn can pass as 2nd argument ofjQuery.post().Alternatively, you can also use the jQuery Form plugin for this, which makes stuff easier.