0

I am trying to get an function to run from an event listener on a form submit.

Chrome & Firefox (Iceweasel) work fine with this code. Internet explorer (Version 9) for some reason requires me to open up the developer tools and close it down straight away for the javascript to work, after the page can be refreshed and the code works fine.

The site is published at http://itdipext.ryanteck.org.uk/enquire.html and the javascript is at http://itdipext.ryanteck.org.uk/javascriptValidate.js

Why Internet Explorer 8?, Heck why javascript for basic form validation? This is for a college assignment where HTML5 does not even exist yet. And internet explorer to make the teacher happy.

Thanks - Ryan Walmsley

Ryan Walmsley
  • 369
  • 1
  • 4
  • 18

1 Answers1

1

It looks like its due to the heavy use of console.log in your script.

IE doesn't create the console object until dev tools is open. You can add this to the top of your script to stop it breaking

var console=console||{"log":function(){}};

Be aware it wont log anything to the console with this in place.

JBB
  • 657
  • 5
  • 14