Reply To: IDs and Classes

Your Account / Forums / Easy FancyBox Pro / IDs and Classes / Reply To: IDs and Classes

May 11, 2015 at 10:36 pm #4987

Hi William,

The ID attribute of any HTML element needs to be unique. It can be whatever you like (as long as it starts with a letter, not a number, and has no special characters) but that same ID it must not be used for other elements. This is a general principle in HTML but it is also important to the FancyBox script because else the script will confuse the two elements with that same ID.

In the example I used “uniqueID” but you could use “popupform-1” and “popupform-2” for two different quote request forms on your Request a Quote page. For example…

In such a case, you’d edit your page in the Text tab and enter this code:


<a href="#popupform-1" class="button fancybox-inline">Personal Quote</a>
<div class="fancybox-hidden">
  <div id="popupform-1" style="width:400px;height:300px">
    [contact-form id="220"]
  </div>
</div>

<a href="#popupform-2" class="button fancybox-inline">Business Quote</a>
<div class="fancybox-hidden">
  <div id="popupform-2" style="width:400px;height:300px">
    [contact-form id="223"]
  </div>
</div>

If in such a case the same ID would be used for both divs, both links would open the same (first) form popup instead of each opening a different one.

Hope that explains it a bit 🙂