<p><script type="text/javascript">// <![CDATA[
span data-mce-type="bookmark" id="mce_0_start" data-mce-style="overflow:hidden;line height:0px" style="overflow:hidden;line-height:0px"></span>// <![CDATA[
function validate(){ var x=document.forms["contactform"]["FirstName"].value; if (x==null || x == '') { alert("First name is mandatory"); return false; } var y=document.forms["contactform"]["LastName"].value; if (y==null || y == '') { alert("Last name is mandatory"); return false; } _gaq.push(['_trackEvent', 'Contact Form', 'Submit']); window.open('/thank-you/'); }
// ]]></script></p>
<form action="https://docs.google.com/macros/exec?service=AKfycbygk9rnr-Iwp11I92KWsBXgfDHXLozZFost-IP" method="post" name="contactform" onsubmit="return validate()">
This is for the consultation form here: http://www.handytax.ca/free-consultation/
This code only results in both a conversion and thank you window open in IE6, IE8 and Firefox. In IE9, Chrome, Safari, and others neither the conversion nor the window open occur. In Chrome, the first and last name validation don’t even occur. How do I fix this?
What is that code inside your script tag
If you check with Chrome console (CTRL-SHIFT-J) you will see
Try to fix it/remove it and your Javascript code should run properly.