- lastfrontierheliAsked on May 11, 2013 at 11:23 AM
When I use a lightbox for my form it causes other scripts not to work on my page. I have an accordian than uses Java to operate and I think the lightbox is causing a conflict in the libraries, specifically prototype.js.
I've commented out the form for the time being on that page in question, here is a link to the page to see the accordian: http://www.lastfrontierheli.com/weather.php
Is there a work around to avoid the library conflict?
- JotForm SupportWelvinAnswered on May 11, 2013 at 01:46 PM
- lastfrontierheliAnswered on May 11, 2013 at 02:45 PM
Thanks for your reply, you continue to be very helpful!
I've read through the jquery no conflict but I'm still a little unclear how to implement it to my page? I understand the concept of making a different alias for "$" I'm just unsure how/where to add the coad to my page?
If you could steer me in the right direction it would be greatly appreciated!
- JotForm SupportjonathanAnswered on May 11, 2013 at 04:22 PM
I could see that you have temporarily commented out the lightbox form script in your web page, so, we could not really see how it is at the moment. Will you be able to re-enable it again? Or try to create a duplicate test page where we make a test.
From what I know, removing 2 in http://cdn.jotfor.ms/static/feedback.js?3.1.318 should do the trick already.
I made a test page here https://shots.jotform.com/jonathan/webtest/lastfrontierheli_lightbox_jquery_script_conflict.php
I used your web page source and I re-enabled the form (it is the red Sign Up Now button). It seems to work. But I can never simulate it fully like on your end.
Hope this help.
- lastfrontierheliAnswered on May 12, 2013 at 11:33 AM
Thanks for your reply and all your work!
In your test there is still the script conflict, if you scroll down you will see bars that have text like "2013 week 16: (apr 13 - apr 19) when you click those bars they are supposed to open like an accordian revealing the weather info from that week. When the lightbox script is not on the page this works fine.
I'm sorry but I cannot enable the form on this page for tested (it is a high traffic page and I need the weather working properly)
Using the jquery no conflict script looks like a viable solution I am just unclear where/how to implement it on my page?
Thanks again! This is easily the most helpful forum I've used.
- lastfrontierheliAnswered on May 13, 2013 at 11:08 AM
Thanks for the replay Jeanette,
Where/what do I declare the noConflict script? I"m assuming in the head of the document but that is the part I'm unsure of the syntax?
- sidharth_kchAnswered on May 13, 2013 at 12:41 PM
You should add the noConflict code just below your jquery reference or before your lightbox code.
Let us know if you continue to have this issue.
- lastfrontierheliAnswered on May 13, 2013 at 01:15 PM
So all I need to do is put:
Before my lightbox? I don't understand how that is supposed to work, how would the browser know what the noConflict function is without declaring it first? (I tried simply adding that code and it didn't work)
- sidharth_kchAnswered on May 13, 2013 at 03:32 PM
Is it possible for you to create a new page (replication of your current page where yu want to add lightbox) on your website and then add Lightbox code? We will then have a check and try to resolve your issue.
- lastfrontierheliAnswered on May 13, 2013 at 11:21 PM
I have made a duplicate of the page with the Lightbox in place. The page can be ofund at:
Any help woulod be greatly appreciated!
- JotForm SupportEltonCrisAnswered on May 14, 2013 at 05:17 AM
We will check possible solution and get back to you today.
Please stay tuned! Thank you!
- JotForm SupportEltonCrisAnswered on May 15, 2013 at 05:49 PM
We are truly sorry for the delay. I am a bit having trouble figuring out a solution and I think this one will work. Here's what I did,
1. On your lightbox embed code, transfer the <script> part above your jQuery reference. Use the following code.
Notice the bolded "2" after feedback, you need that since prototype codes wont work on your page.
2. You don't need noConlfict codes anymore, please removed them.
3. Checkout this demo: https://shots.jotform.com/elton/jquery_conflict_216112.html
Hope this helps. Thank you!
- lastfrontierheliAnswered on May 15, 2013 at 06:25 PM
Genuis! Works prefect, thank-you!
I can honestly say Jotform offers the best support/forum I've experienced in almost a decade develping for web.
- JotForm SupportEltonCrisAnswered on May 15, 2013 at 09:35 PM
Glad to hear it works for you and thanks for your positive remarks!
If you come across any issues again, feel free to contact us here.