JQuery in form stops display rule...

User 2062767 Photo


Registered User
166 posts

Using jQuery in form stops display rule working on Microsoft Edge.

This only happens on Microsoft Edge, everything works fine on Chrome. The only way I can solve this problem is to export the form files, then placing the jQuery scripts in the <head> tag. It is a bit of a pain having to do this every time.

Adding no-conflict to the jQuery markup does not help.

Can anyone help with this?
www.heylisflorist.co.uk - My Florist Shop.
www.woodentopstoys.co.uk - My Wooden Toy Shop.

I use CoffeeCup HTML Editor, WIS, Direct ftp, Sitemapper, Website Insite & RED Personal to create my websites.

Send your parcels with Despatch Bay! Signup using this code and get £10.00 worth of free shipping http://despatchbaypro.com/s/1H431
User 187934 Photo


Senior Advisor
20,181 posts

Hi Sue,
If you share a link to the actual page with the form I bet we can help you out.
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 2062767 Photo


Registered User
166 posts

I have created a simple form for you to test. I have used a jQuery from one of your posts (so I know it should work). I have just taken out the .hide() bit so you can see the text field with the URL in. Although I have found the jQuery does not always work either!

Here is a link to the WFB form: http://woodentopstest.coffeecup.com/forms/display_rule_test/

Here is a link to the same form that I have exported & moved the scripts to the <head> tag: http://woodentopstest.coffeecup.com/form-display-test/display_rule_test_exported/display_rule_test/display_rule_test.html

Please compare in Edge & Chrome & any other browsers you can think of.
www.heylisflorist.co.uk - My Florist Shop.
www.woodentopstoys.co.uk - My Wooden Toy Shop.

I use CoffeeCup HTML Editor, WIS, Direct ftp, Sitemapper, Website Insite & RED Personal to create my websites.

Send your parcels with Despatch Bay! Signup using this code and get £10.00 worth of free shipping http://despatchbaypro.com/s/1H431
User 187934 Photo


Senior Advisor
20,181 posts

Try it like this and place it at the bottom of your page just above the </body> tag..
<!-- Script moved from body -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
var jQ = $.noConflict();
jQ(document).ready(function() {
var referrer = document.referrer;
jQ("input[name='referrer']").val(referrer);
})</script>
<!-- End of Script moved from body -->
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 2062767 Photo


Registered User
166 posts

That is only any good if I export & edit the html, I don't really want to be doing that on every update to my form. I would like it to work on the actual form created by WFB.

I have come up with this, same form as before:
http://woodentopstest.coffeecup.com/forms/display_rule_test/

Please inspect elements #item1 & look at the new <footer> tag.

Is there anyway this is going to work? The scripts are written in the footer but not working. Is this because they are not being read until after page has loaded?
www.heylisflorist.co.uk - My Florist Shop.
www.woodentopstoys.co.uk - My Wooden Toy Shop.

I use CoffeeCup HTML Editor, WIS, Direct ftp, Sitemapper, Website Insite & RED Personal to create my websites.

Send your parcels with Despatch Bay! Signup using this code and get £10.00 worth of free shipping http://despatchbaypro.com/s/1H431
User 187934 Photo


Senior Advisor
20,181 posts

Here's a plain js option that should work.
<script type="text/javascript">
window.onload = function(){
document.getElementsByName("referrer")[0].value = window.location.href;
}
</script>


And here's the version that hides it. Adjust the item2 to the id of the outer div that contains the input.
<script type="text/javascript">window.onload = function(){
document.getElementById("item2").style.display='none';
document.getElementsByName("referrer")[0].value = window.location.href;
}</script>
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.