Jump to content

Auto submission of exam result when time is over


Guest lenix

Recommended Posts

  • 3 weeks later...

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

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.