Guest lenix Posted February 6, 2013 Share Posted February 6, 2013 Hi phpfreaks. . how to auto submit(calculated already) exam result on the database after the countdown timer reaches to zero.. ->I know phpfreaks can help me. Big thanks in advance. 143 all!!! Quote Link to comment https://forums.phpfreaks.com/topic/274089-auto-submission-of-exam-result-when-time-is-over/ Share on other sites More sharing options...
requinix Posted February 6, 2013 Share Posted February 6, 2013 You can submit the form in Javascript by calling the .submit() method on it. Quote Link to comment https://forums.phpfreaks.com/topic/274089-auto-submission-of-exam-result-when-time-is-over/#findComment-1410398 Share on other sites More sharing options...
Guest lenix Posted February 6, 2013 Share Posted February 6, 2013 Thank you so much for a that great idea guru requinix. Quote Link to comment https://forums.phpfreaks.com/topic/274089-auto-submission-of-exam-result-when-time-is-over/#findComment-1410399 Share on other sites More sharing options...
Guest lenix Posted February 22, 2013 Share Posted February 22, 2013 I'm stuck guru requinix. . pls help me. I don't know how to use .submit() method.(as Im new to Javascript) . What I did is just loading the query(for inserting to DataBase). ex: process_exam.php automatically when time is Over using document.location='process_exam.php'; . When the page loaded it is only showing empty page and nothing happens. Instead of diplaying "YOU HAVE FINISHED THE EXAM" then the data have been save already to the database Quote Link to comment https://forums.phpfreaks.com/topic/274089-auto-submission-of-exam-result-when-time-is-over/#findComment-1414087 Share on other sites More sharing options...
Solution kicken Posted February 22, 2013 Solution Share Posted February 22, 2013 First, make sure your form has an ID on it. <form id="yourform"> Then you just get a reference to that form using getElementById() and call it's .submit() method. document.getElementById('yourform').submit(); Just changing the location (document.location='blah';[/) like you did does not submit any of the form details, so your processing script would not have an of the data it needs to do it's job. Quote Link to comment https://forums.phpfreaks.com/topic/274089-auto-submission-of-exam-result-when-time-is-over/#findComment-1414097 Share on other sites More sharing options...
Guest lenix Posted February 28, 2013 Share Posted February 28, 2013 Thanks a lot guru kicken. . My problem was solved.. Quote Link to comment https://forums.phpfreaks.com/topic/274089-auto-submission-of-exam-result-when-time-is-over/#findComment-1415603 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.