Hi All,
I have complete a set of web pages that are to be used to examination for students. I am using JavaScript throughout to generate test items, collect responses calculate results. What I need to do at the end of this process, as soon as the student quits the exam, is to send the results to the centre by email.
I dynamically populate a form with the appropriate values and then the document.submit method is used to call a php program that will receive the values and send these on.
The only problem I have is that when the php program has done it's job of taking the form and sending this off as an email, it then opens a window on the browser.
Is this behaviour something I can get around. I would rather have the email sent and the user carry on as if nothing had happened.I don't really want the user to be aware of the email being sent!
Is this possible?
Here is part of the code.
Code:
var ResultForm = '<html><body><form name="Results" action="http://glen.com/FormToEmail.php" method="post" enctype="x-www-form-encoded">';
ResultForm += '<input type="hidden" name="recipient" value="[email protected]"></input>';
//ResultForm += '<input type="hidden" name="subject" value="TEST QUESTIONS"></input>';
ResultForm += '<input type="hidden" name="Exercise" value="TEST PAPER 1"></input>';
ResultForm += '<input type="hidden" name="realname" value=""></input>';
//ResultForm += '<input type="hidden" name="Score" value=""></input>';
ResultForm += '<input type="hidden" name="Start_Time" value=""></input>';
ResultForm += '<input type="hidden" name="End_Time" value=""></input>';
..........
..........
NewWin.document.Results.Stats.value = message;
NewWin.document.Results.submit();
Thanks
John Lundrigan
برچسب:
نویسنده: آیلین رضوانی
تاريخ: يکشنبه
10 دی
1396 ساعت: 9:38