function ProcessFields(form,NoOfQuestions) { if (form.StudentName.value == "") form.StudentName.value = prompt("Ecrivez votre nom.", "") else { msgWindow=window.open('','msgWindow','toolbar=yes,location=no,directories=no, status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=500'); msgWindow.document.open() msgWindow.document.write("Réponses"); msgWindow.document.write(""); msgWindow.document.write(""); msgWindow.document.write ("

" + form.name + "

"); // form name contains title msgWindow.document.write ("

" + form.StudentName.value + "
"); msgWindow.document.write (new Date() + "

"); //NoOfQuestions = form.elements.length-2; // Last 2 elements are Button and StudentName // Use this line only to calcualte the number // automatically. for (i=0; i < NoOfQuestions; i++) { msgWindow.document.write ("

" + (i+1) + ".  "); msgWindow.document.write (form.elements[i].value + "

"); } msgWindow.document.write(""); msgWindow.document.close(); if (navigator.appName.indexOf ("Netscape") >= 0) { msgWindow.print() } } } // end of JavaScript Function ProcessFields