Answer the question
In order to leave comments, you need to log in
How to pass value from Span to Contact Form 7?
Guys, such a question.
There is a drop-down list on the site and under it the order button, it opens a modal window. The form is made on Contact Form 7. The question is, how can I pass the value from the drop-down list when submitting the form?
Writing a separate form is not an option
<div class="delivery_block active">
<div class="delivery_list"><div class="btn"> </div>
<span class="choose">10 х 15 х 7</span>
<span class="anymore"><b>все <br> размеры</b></span></div>
<ul class="cities_list" style="display: block;">
<li>10 х 15 х 7</li>
<li>10 х 15 х 8</li>
<li>10 х 15 х 9</li>
<li>10 х 15 х 10</li>
<li>10 х 15 х 7</li>
<li>10 х 15 х 8</li>
<li>10 х 15 х 9</li>
<li>10 х 15 х 10</li>
</ul>
</div>
Answer the question
In order to leave comments, you need to log in
in CF7 you need to create hidden field type="hidden"
in js add handler
$('.cities_list li').on('click', function(){
var size = $(this).text();
$('#ID_hidden_input').val(size);
});
In theory, you can pass the value to the contact form using js code on the client side. Hang the handler on the modal open button and when clicking on it, pass the selected value to the field.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question