I have a PHP and HTML application of a registration form, how do I download a select as an example: Clicking on yes, it downloads according to a link that does this (download) in pdf format. Follow the print for more information and the script as well. '
<script>
function carregaPdf(){
if(document.getElementById("alojamento").value == "SIM"){
window.open("http://www.ibc.gov.br/media/common/regulamento_interno_do_alojamento_ibc.pdf");
}
}
</script>
<div class="form-group">
<label class="col-sm-2 control-label">Alojamento</label>
<div class="col-sm-10">
<select onchange="carregaPdf()" class="form-control" name="alojamento" id="alojamento" style="width:100px; padding:2px;" required>
<option value="">Selecione</option>
<option value="SIM">SIM</option>
<option value="NAO">NÃO</option>
</select>
</div>
</div>
My doubt is that you are opening a window with the pdf, I want you to force the download of the pdf file as soon as you click on yes, can anyone help me?