Hey there, I'm currently working on a project that involves conducting surveys. Each page of the survey presents a new question for the user to answer, and upon submission, the user is redirected to the next question. The javascript code below allows this functionality.
function nextPage (nurl,findate,user_type) {
if(((findate == null)||(findate=="0000-00-00"))&&((user_type != "survey owner"))&&(user_type !="PI admin")){
document.showQuestionAnswerForm.submit();
scode= document.getElementById('surveyCode').value;
parent.SurveySummaryFrame.location="load_survey.php?scode="+scode + "&template=" + '<? echo $_GET["template"]?>';
}
window.location.href=nurl;
}
While this code is mostly reliable with Firefox and IE6, it occasionally encounters issues with IE7, IE8, and consistently fails with Google Chrome. Removing window.location.href=nurl;
allows for successful submission, though leaving it uncommented leads to the user response not being saved before moving to the next url.
My suspicion is that certain browsers process the code too quickly, potentially skipping the submission step. I'm in desperate need of a solution to rectify this issue. Any assistance would be greatly appreciated.