1
I have a project developed in Bootstrap, which when clicking on link Products, will open a Modal ( from Bootstrap ) with the listed products. However, I would like that when clicking on one of the products the modal closed and the product clicked appeared in a <div>
under the link clicked. Even the modal and the list of products I managed to do, but the name of the product appears below the link clicked I couldn’t. Someone could help me?
<script type="text/javascript">
function Aparecer(produto){
var nome;
document.getElementById("Produtos").innerHTML = produto;
}
</script>
<a href="#" onclick="javascript:Aparecer(<?php echo $produto; ?>)">Selecionar</a>
<div id="Produtos"></div>
Could show what you’ve tried?
– falsarella
Hello fakarella. I edited and put the code.
– user24136
So, if I understood correctly, when the user choose a product in modal, is for the name appear below the link Products and close the modal?
– falsarella
That... even the modal managed to arrive....
– user24136
I made a change to the code. I managed to make it appear on the same page, but how I would make the modal to close and the selected product appear below the link I reported earlier on the other page?
– user24136