Is it possible to get a result of a JavaScript function and play this result inside a Modal?
I have this function:
<script>
$('#download').click(function() {
document.getElementById('xxxx').disabled=false
document.getElementById('xxxx').disabled=false
var formData = $(document.forms[0]).serialize().split('&').join('\n');
this.href = 'data: ,' + formData ;
document.getElementById('xxxx').disabled=true
document.getElementById('xxxxx').disabled=true
});
</script>
The result "formData" would have to be played within a modal Popup. His code:
<div class="bs-example">
<!-- Button HTML (to Trigger Modal) -->
<a href="#myModal" class="btn btn-lg btn-primary" data-toggle="modal" >Clique aqui para ver a janela</a>
<!-- Modal HTML -->
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Atenção!</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-primary">Salvar tudo</button>
</div>
</div>
</div>
</div>
</div>