I have a page that contains multiple, identical hidden forms, each contained in a separate hidden DIV as such:
HTML:
<div class="product-intro-text">Some text....
<div class="rfq-button"><a class="advantage-button" id="Adapters" href="#">Request a Quote</a></div>
<div class="inline-rfq">
<form class="contact" name="contact" action="#" method="post">...</form>
</div>
</div>
<div class="h-sep"></div>
<div class="product-intro-text">Some text....
<div class="rfq-button"><a class="advantage-button" id="Auger Equipment" href="#">Request a Quote</a></div>
<div class="inline-rfq">
<form class="contact" name="contact" action="#" method="post">...</form>
</div>
</div>
Instead of having all of these identical hidden DIVs, how can I reposition the .inline-RFQ DIV to appear below the corresponding .rfq-button that was clicked? This is for a mobile site, so solutions would have to be mobile-friendly.
I’m already using JS/JQuery throughout the rest of the page and here is the JS that reveals the hidden DIV:
jQuery(document).ready(function($){
/* toggle form */
$(".rfq-button").on("click", function(){
$(this).next().slideToggle();
$(".inline-rfq").next().toggleClass("display");
});
});
Thanks for your help in advance.
Here’s a fiddle: http://jsfiddle.net/psyon001/ejdgX/
One thing you may want to add is reseting the form states when showing under a new section.