R
R
Rinat Sadykov2017-04-16 08:10:52
JavaScript
Rinat Sadykov, 2017-04-16 08:10:52

How to pass product ID to FANCYBOX3 modal window?

Tell me please.
There is a product, when you click on it, a fancybox3 modal window opens with an order form. How to pass the product ID to this form, for example, in input type="hidden". Thank you very much in advance.

<a class="slide2-order" id="item1" data-fancybox data-src="#order-popup" href="javascript:;"></a>


 <div class="popup" id="order-popup">
    <form action="/send_form/send.php" method="post" enctype="multipart/form-data">
       <input type="hidden" value="ID товара">
    </form>
 </div>


 <script type="text/javascript">
             $("[data-fancybox]").fancybox({
          	});
          </script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
riot26, 2017-04-16
@Ruinevo

https://jsfiddle.net/skzhyeou/
fancybox beforeLoad event: fancyapps.com/fancybox/3/docs/#events
Working with jQuery data attributes: https://api.jquery.com/data/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question