jnylund
09-11-2009, 04:43 PM
Hi, I have a form and an on click event below, I noticed that sometimes the window.location is being called before the submit happens, and the form never gets submitted, I fixed the code by returning false after doing the form submit, but im trying to understand how this could happen. Is form.submit asynchronous and allows window.location to take over, why does it work sometimes and not other times? I noticed when I debug in firebug, it always work (probably because submit has time to work)
thanks
Joel
function mySave(n){
if(clicked =="n")
document.journal.submit();
return true;
}
javascript:clicked='n';prevl='f'; if(mySave(this.id))window.location='Main.htm?page=5&from=p';
thanks
Joel
function mySave(n){
if(clicked =="n")
document.journal.submit();
return true;
}
javascript:clicked='n';prevl='f'; if(mySave(this.id))window.location='Main.htm?page=5&from=p';