Answer the question
In order to leave comments, you need to log in
How to pass value to modal window?
Hello. I have a catalog.section component and a button to cart. I need that when this button is clicked, a modal window opens and parameters are passed there - for a start, at least the name of the product.
How can I do it?
I understand that the onclick event should be hung on this button
<div id="nameofproduct">Здесь имя товара</div>
<button onclick="openwindow('<?=$arItem["NAME"]?>')">В корзину</button>
<script>
function(openwindow){
//что тут писать
}
</script>
Answer the question
In order to leave comments, you need to log in
$( document ).ready(function() {
$('button.class').click(function(){
$(div.class).text($('#nameofproduct'));
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question