I want my form to post to a specific url through the action attribute, but redirect to a thank you page.
I have tried this
$(function() {
$('.profile-form').submit(function(){
$.post('/?target=profile', function() {
window.location = '/thank-you-prize-wheel.html';
});
return false;
});
});
The above code redirects the page but doesn’t post to the specified URL, not even if I use an absolute path
what am I doing wrong?