From This answer and the fact i may be using an anti pattern I thought i should change the ajax call into behavior like submitting a form. I found $.post but that seems to be doing ajax and does not change the page i am on.
How do i submit a form with jquery or plain JS?
It’s as simple as calling the
$.submit()method on the form itself:Or if you’re using the name attribute only:
If you’re only interested in redirecting the page after you submit the data, you could do this from the callback of the
$.post()call:Update:
The asker indicated in the comments below that no form actually exists. I would suggest creating one:
And then adding your data:
And later, when you’re ready, submit it: