D
D
DamianTrash2021-07-17 14:13:55
fancyBox
DamianTrash, 2021-07-17 14:13:55

How to pass value from button to form in fancybox modal?

Good day to all. There is a catalog site. In the list of goods there are buttons "Order". Clicking on these buttons opens a simple form using fancybox. To identify the abandoned order, you need to transfer any value from the "Order" buttons (for example, the name of the product) to the form. I've searched all over the Internet. If there are answers, then 2013, which even in the examples do not work. Can anyone suggest an option?

Now the form is called like this

<div data-fancybox="form_modal" data-src="#form_request" >Заказать</div>


The form itself
<div id="form_request" style="display:none;">
<form action="" method="post">
....
<form >
</div>


Those. the point is to be something like this:
<div data-fancybox="form_modal" data-src="#form_request" data="НАЗВАНИЕ ТОВАРА">Заказать</div>

<div id="form_request" style="display:none;">
<form action="" method="post">
<input type="text" value="НАЗВАНИЕ ТОВАРА">
....
<form >
</div>


Thanks in advance if anyone can help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question