form_init.js messing up other...

User 2614204 Photo


Registered User
23 posts

I have the form working fine, but form_init.js is conflicting with other javascripts on the page, so nothing else works. I have commented out the form_init.js and it still works! However a neat little addition by this gentleman here will not http://www.coffeecup.com/forums/web-for … ost212728. Is there any way of working out what is conflicting? I'm fine with html and css but utterly clueless about javascript and jquery.

(please scroll down to 'comments' in links below)
url with form_init.js commented out: http://withnature.co.uk/test/index3.php
url WITH form_init.js: http://withnature.co.uk/test/index2.php

Any help would be much appreciated, thank you.
User 187934 Photo


Senior Advisor
20,193 posts

You can try doing a no conflict for your scripts or try rearranging the order of the scripts.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2614204 Photo


Registered User
23 posts

Thank you for your reply Eric :)
I've tried rearranging the order, and had partial success by placing the form_init call at the very end of the page before </body>, but unfortunately it's still conflicting with other elements on the page.
May I ask what you mean by doing a "no conflicts"?
User 2614204 Photo


Registered User
23 posts

I've been trying adding this as described on the official jquery site
http://learn.jquery.com/using-jquery-co … libraries/ and edited the form_init file changing $ to jQuery
but to no avail, it just displays the background image and nothing else.

<!-- Another way to put jQuery into no-conflict mode. -->
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>

jQuery.noConflict();

jQuery( document ).ready(function( $ ) {
// You can use the locally-scoped $ in here as an alias to jQuery.
$( "div" ).hide();
});

// The $ variable in the global scope has the prototype.js meaning.
window.onload = function(){
var mainDiv = $( "main" );
}

</script>
User 187934 Photo


Senior Advisor
20,193 posts

Ive had good success with placing any other scripts above the form builders scripts in the head of the page. Also have you tried using an iframe to embed the form?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2614204 Photo


Registered User
23 posts

Thank you Eric! Problem resolved by using iframe.
User 2614204 Photo


Registered User
23 posts

Ah! The only problem with using iframe is that it messes this up...http://www.coffeecup.com/forums/web-form-builder/web-form-builder-html-version-tips-and-tricks/?post_id=212728#post212728

Does anyone know of another way I can catch the url of the page that the frame is loaded in? I've tried adding that tip above to the main page but it doesn't work like that unfortunately.

Any ideas much appreciated.
User 187934 Photo


Senior Advisor
20,193 posts

Setup your input like this
<input name="text1" id="item1_text_1" type="text" maxlength="254" placeholder=""
autocomplete="off" data-hint="" value="<?php echo $_SERVER['HTTP_REFERER'];?>" />

Here you can see it in action
http://ericrohloff.com/coffeecup/ccforu … iframeurl/
You'll need to remove the script wrapping the iframe code the the form builder generates.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.