Hello there,
I am trying to figure out why this function (submit form) doesn't work in Safari (or Firefox) but only in IE. Any reference to where I can find the answer or learn about tricks on how implementing javascript to work across browser would be great! Thanks.
The closeWindow() function works fine in all browsers...
I am trying to figure out why this function (submit form) doesn't work in Safari (or Firefox) but only in IE. Any reference to where I can find the answer or learn about tricks on how implementing javascript to work across browser would be great! Thanks.
The closeWindow() function works fine in all browsers...
Code:
{literal}
function submitForm() {
var start = document.getElementById("start").value;
var end = document.getElementById("end").value;
var sa = start.split("-");
var ea = end.split("-");
var d1 = new Date();
d1.setFullYear(sa[0],sa[1],sa[2]);
d1.setHours(0,0,0,0);
var d2 = new Date();
d2.setFullYear(ea[0],ea[1],ea[2]);
d2.setHours(0,0,0,0);
//document.write(d);
if(d1.getTime() >= d2.getTime())
alert("End-Date should be later than Start-Date.");
else{
document.form1.submit();
window.opener.location="?a=goal&rand="+rand+"#"+goal;
}
}
function closeWindow() {
window.close();
window.opener.location="?a=goal&rand="+rand+"#"+goal;
}
{/literal}