I have a jQuery ajax
form where a user submits his email, once the form has been submitted, the user should get an automated download of a file, the form looks like this:
$(".email-form").submit(function(event) {
event.preventDefault();
var $form = $(this),
form_email = $form.find("input[name='email']").val(),
url = $form.attr("action");
var posting = $.post(url, { email: form_email });
posting.done(function() {
$(".popup-design").hide();
$("input[name='email']").val("");
$("#done").show();
});
});
and also I need to have to user automatically download a file of my choice when posting
is done
. How can I do that?