I need to send a pdf file to user immediately after user click submit form button. Plugin use Ajax send form so page is not refresh. I don't have an advanced knowledge in programming, and I didn't find right solution for now. What I think that I can create link and at the same time do click and file will start download. But I don't know the right way how to do it. What I think I can do is:
$('form input[type="submit"]').click(function(){
$('form input[type="submit"]').after('<a href="http://www.mywebsite.ru/bitrix/myfile.pdf" class="download-file"></a>');
$('.download-file').click();
})
But I'm not shure will this work, and is it true way send file to user by this way after form submit. So I need some body to explain and may be some example, what is the easiest way to send file to user after form submit. Also I have some knowledge in jQuery, but my Ajax knowledge very bad :(