The command document.location.href=”www.google.com” is not working in google chrome browser.
So your question would be Why Location.href not working?
So there are two ways in order to fix this problem.
1. Avoid Using Form Element
You can put your button outside form, if there is no other way, you have to kept button inside form then change the button type to ‘Button’, I think by default its submit.
2. Use Simple Code
window.event.returnValue = false;
This one line of code can fix this issue but this only works in Google Chrome not in Firefox, you have to add some checks like if browser is Chrome or not if yes then execute above code else you can use simple location.href.
Other case when location.href does not work
Hope this will help you to fix your same problem.